Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

COS 1512 ASSIGNMENT 1

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
09-09-2021
Written in
2021/2022

Question 1 //Calculate tuition fees based on number of new modules //and the number of repeat modules #include iostream using namespace std; int calcFees (int numberOfNewModules, float nModFee) { return (numberOfNewModules * nModFee); } int calcFees (int numberOfNewModules, float newModFee, int numberOfRepeatModules, float repeatModFee) { return (numberOfNewModules * newModFee + numberOfRepeatModules * repeatModFee); } int main() { int numberOfRepeatModules, numberOfNewModules; float tuitionFeeNew, tuitionFeeRepeat; const float repeatModuleFee = 500.00; const float newModuleFee = 800.00; char repeatingModules; cout "Are you repeating any modules? " endl ; cout "If yes, please enter 'Y', else enter 'N': " endl ; cin repeatingModules; switch (repeatingModules) { case 'y': case 'Y': cout "How many modules are you repeating? "; cin numberOfRepeatModules; break; case 'n': case 'N': numberOfRepeatModules = 0; break; default: cout "Please only answer with 'Y' or 'N'" endl ; } This study source was downloaded by from CourseH on :34:44 GMT -05:00 This study resource was shared via CourseH cout "How many modules are you taking for the first time? " endl ; cin numberOfNewModules; tuitionFeeNew = calcFees(numberOfNewModules, newModuleFee) ; tuitionFeeRepeat = calcFees(numberOfNewModules, newModuleFee, numberOfRepeatModules, repeatModuleFee) ; (ios::fixed); sion(2); if (numberOfRepeatModules == 0) cout endl "Your total tuition fee will be: R" tuitionFeeNew endl; else cout endl "Your total tuition fee will be: R" tuitionFeeRepeat endl; return 0; } Input and Output: (a) Are you repeating any modules? If yes, please enter 'Y', else enter 'N': y How many modules are you repeating? 3 How many modules are you taking for the first time? 3 Your total tuition fee will be: R3900.00 Press any key to continue . . . (b) Are you

Show more Read less
Institution
Course









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

Written for

Institution
Course

Document information

Uploaded on
September 9, 2021
Number of pages
5
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$3.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
AcademicFountain Johns Hopkins University School Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
44
Member since
4 year
Number of followers
30
Documents
359
Last sold
7 months ago

3.5

4 reviews

5
1
4
0
3
3
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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions