100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS1512 Assignment 2 2023 (DUE : 6 July 2023) $2.70   Add to cart

Exam (elaborations)

COS1512 Assignment 2 2023 (DUE : 6 July 2023)

 16 views  2 purchases
  • Course
  • Institution

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...

[Show more]

Preview 3 out of 19  pages

  • June 27, 2023
  • 19
  • 2022/2023
  • Exam (elaborations)
  • Questions & answers
avatar-seller
COS1512 Assignment 2 2023 (DUE : 6 July 2023)

, Assignment 2 2023


DUE DATE: 3 July 2023
CUT-OFF DATE: 6 July 2023

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

Opening balance: R3750.40

Transaction Amount Balance Bank costs
Withdrawal 250.00 4000.00
Deposit 1200.00Ct 2800.00
Withdrawal 75.00 2725.00
Withdrawal 1375.00 1350.00
Deposit 1200.00Ct 1550.00
Interest 5.50 1555.50
Withdrawal 400.00 1155.50
Withdrawal 600.00 555.50 25.00
Deposit 450.00Ct 1005.50
Withdrawal 35.65 969.85
Banking costs 25.00 969.60

Closing balance: R969.60

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller LOVELY01. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $2.70. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

66579 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$2.70  2x  sold
  • (0)
  Add to cart