COS1512 Assignment 2 2023 (DUE : 6 July 2023). 100% CORRECT questions, answers, workings and explanations. for assistance. Question 1 Write a program to determine the tuition fees for a student. The program should use two overloaded functions, each named calcFees, to determine the tuition fees f...
TUTORIAL MATTER: Chapters 4, 5, 6, 8 and 9 of the Study Guide
Chapters 4 (section 4.6), 5 (section 5.5), 6, 8 and 9
(excluding the optional parts of section 9.2) of
Savitch
WEIGHT: 30%
MARKS: 70
Question 1
Write a program to determine the tuition fees for a student. The program should use
two overloaded functions, each named calcFees, to determine the tuition fees for a
student. Students who repeat a module pay a different fee for the modules which are
repeated. The program should first ask if the student repeats any modules. If the
student repeats, the program should ask for the number of modules which are
repeated.
One of the overloaded functions should accept the number of modules enrolled for the
first time and the fee for those modules as arguments (parameters), while the other
function accepts arguments for the number of modules enrolled for the first time and
the fee for those modules as well as the number of modules repeated and the fee for
those modules. Both functions should return the tuition fees for the student.
Question 2
Write a program that converts from 24-hour notation to 12-hour notation. For example,
it should convert 14:25 to 2:25 PM. The input is given as two integers. Verifies that a
legitimate 24-hour notation has been input by using the assert statement.
Question 3
Write a program for your local bank to prepare a statement for a customer’s checking
account at the end of each month. The data is stored in a .dat file in the following
format:
, 46780976 3750.40
W 250.00
D 1200.00
W 75.00
W 375.00
D 1200.00
I 5.50
W 400.00
W 600.00
D 450.50
W 35.65
The first line of code shows the account number followed by the account balance. For
each line of code there is a transaction code and the transaction amount. The
transaction codes are as follows:
W = Withdrawal
D = Deposit
I = Interests
The program has to display the account statement on the console. It should update
the balance after each transaction. During the month, if at any time the balance goes
below R 1000, a R25 service fee is charged. The program should print the following
information: account number, opening balance at the beginning of the month, each
transaction as it occurs, service fees when charged, interest paid by the bank and
closing balance at the end of the month. Banking costs (i.e. total of all service fees
incurred) are deducted at the end of the month. An example of the output your program
should produce for the input file above, is shown below. Note that a deposit is shown
as a credit (‘Ct’) on the statement:
Sample output:
Account number: 46780976
Voordelen van het kopen van samenvattingen bij Stuvia op een rij:
√ Verzekerd van kwaliteit door reviews
Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!
Snel en makkelijk kopen
Je betaalt supersnel en eenmalig met iDeal, Bancontact of creditcard voor de samenvatting. Zonder lidmaatschap.
Focus op de essentie
Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!
Veelgestelde vragen
Wat krijg ik als ik dit document koop?
Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.
Tevredenheidsgarantie: hoe werkt dat?
Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.
Van wie koop ik deze samenvatting?
Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper LOVELY01. Stuvia faciliteert de betaling aan de verkoper.
Zit ik meteen vast aan een abonnement?
Nee, je koopt alleen deze samenvatting voor €2,64. Je zit daarna nergens aan vast.