100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COS1512 ASSIGNMENT 2 SOLUTIONS 09 JULY 2023

Rating
-
Sold
-
Pages
16
Grade
A+
Uploaded on
09-07-2023
Written in
2022/2023

COS1512 ASSIGNMENT 2 SOLUTIONS 09 JULY 2023

Institution
Course










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Course

Document information

Uploaded on
July 9, 2023
Number of pages
16
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COS1512 ASSIGNMENT 2
SOLUTIONS 09 JULY 2023

written by

primenovice




www.stuvia.com



Downloaded by: ramaanoemmanuel | Want to earn
Distribution of this document is illegal R13,625 per year?

, Stuvia.com - The study-notes marketplace




COS1512 ASSIGNMENT 2 2023


QUESTION 1

#include <iostream>
using namespace std;
double calcFees(int nrModules,double fees)
{
return nrModules*fees;


}
double calcFees(int firstModule,double firstFees,int repModules,double repFees)
{


double total;
total=firstModule*firstFees+repModules*repFees;
return total;
}
int main()
{




char answer;
cout<<"Are you repeating any modules:Y\\N: ";
cin>>answer;
int firstModules;



Downloaded by: ramaanoemmanuel | Want to earn
Distribution of this document is illegal R13,625 per year?

, Stuvia.com - The study-notes marketplace




double firstFees;
if(answer=='Y')
{


double repFees;
int repModule;
cout<<"Enter the number of modules you are doing first time: ";
cin>>firstModules;
cout<<"Enter the fees for first time modules: ";
cin>>firstFees;
cout<<"Enter the number of modules you are repeating: ";
cin>>repModule;
cout<<"Enter the fees for modules repeated: ";
cin>>repFees;
cout<<"Your tuition fees are: R"<<calcFees(firstModules,firstFees,repModule,repFees);
}
else
{
cout<<"Enter the number of modules you are doing first time: ";
cin>>firstModules;
cout<<"Enter the fees for first time modules: ";
cin>>firstFees;
cout<<"Your tuition fees are: R"<<calcFees(firstModules,firstFees);


}
return 0;


}




Downloaded by: ramaanoemmanuel | Want to earn
Distribution of this document is illegal R13,625 per year?
$9.13
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
ramaanoemmanuel

Get to know the seller

Seller avatar
ramaanoemmanuel COS2614
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions