Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
4 views

Summative Programming Assignment

The document provides instructions for a program to help balance a checking account. The program allows the user to enter starting balance and transactions including deposits and withdrawals. It calculates the new balance after each transaction, tracks balances below $1000 and $50 thresholds, and deducts service charges as needed. The output displays transaction details, current balance, and warnings or charges at each step until the user confirms they are done.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Summative Programming Assignment

The document provides instructions for a program to help balance a checking account. The program allows the user to enter starting balance and transactions including deposits and withdrawals. It calculates the new balance after each transaction, tracks balances below $1000 and $50 thresholds, and deducts service charges as needed. The output displays transaction details, current balance, and warnings or charges at each step until the user confirms they are done.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Summative Programming Assignment #3

You can work with your partner


Note: Functions, local variables, do while loop, if else-if can be used.
Your task:
How many of you maintain your checking account? Hopefully, everyone! To help with this
process, you have decided to write a C++ program to help you balance your checking account.
This program should let you enter a starting balance for the month, followed by a series of
transactions (meaning deposits and withdrawals) that happen throughout the month.

When someone makes a transaction, you need to do the following:


· echo the transaction date, the current balance in the account.
· If the balance drops below $1000.00 at any time during the month, a onetime service
charge of $20.00 is assessed (taken from you!) for the month.
· If the balance drops below $50, a warning message is displayed.
· If the balance becomes negative, an additional service charge of $25 should be assessed
(taken from you) every time you make a withdrawal until your balance is no longer
negative (ouch!).

You are welcome to make these fees variables that you read in from the user. But you don’t have
to! They can be constants in your program. (For example: float service charge = $25;

Things you should know...as part of your program


a. The input for the program should be:
1) The initial balance (entered just once) at that start of the program
2) Within a LOOP, ask the user to enter a transactions type. There are two kinds of
transactions: deposit and withdrawals. Ask the user which type (d for deposit, w
for withdrawl)
3) Each transaction consists of (ask the user for):
i. The date (month, day, year)
ii. Amount of deposit or the amount of the withdrawal
4) Repeat the loop until the user indicates that there are no more transactions

b. Make sure to echo all of the input – and make sure each value echoed has a meaningful label
(tell me what is it). Make sure to display all dollars and cents using proper format ($ sign and
2 digits after the decimal point) setprecision(2)
cout.setf(ios::fixed);
cout.setf(ios::showpoint);

c. ERROR check! If the input isn’t a ‘d’ or a ‘w’ when entering in the type of transaction,
display an error message and give the user another chance to enter the choice.

· REMEMBER don’t forget to add comments and to work on your program’s readability; this is 5%!!

Steps:
Step 1: Welcome the user

Step 2: Get information from the user

• Starting balance
Step 3: Do calculations
1.
Repeat
2.
ask them the date (month, day, year)
3.
echo date
4.
ask them transaction type (deposit or withdrawal)
if it’s a deposit, …
5.
if it’s a withdrawal, ….
6.
7.
ask them if there are there any more transaction to do this month. If they say yes,
go back to number 1. if the say no go on to step 4
Step 4: Thank the user for using the program

Your application output should look like:


--------------------------------------------------------------------------------
How much money is in your account this month? 1500

Are you making a deposit or a withdrawal? d

What months, day, and year is it (ex 9 30 2020): 9 30 2020

It is 9/30/2020

How much is your deposit? 500.00

Your current balance is: $2000.00

Do you have more transactions? y

---------------------------------------------------------------------------------

Are you making a deposit or a withdrawal? w

What months, day, and year is it (ex 9 30 2020): 9 30 2020

It is 9/30/2020

How much is your withdrawal? 100.00

Your current balance is: $1900.00

Do you have more transactions? y

---------------------------------------------------------------------------------

Are you making a deposit or a withdrawal? w

What months, day, and year is it (ex 9 30 2020):? 9 30 2020

It is 9/30/2020

How much is your withdrawal? 1500.00

Your current balance is: $400.00

The following service charge was deducted from your account: $25.00
Do you have more transactions? y

---------------------------------------------------------------------------------

Are you making a deposit or a withdrawal? d

What months, day, and year is it (ex 9 30 2020):? 9 30 2020

It is 9/30/2020

How much is your deposit? 100.00

Your current balance is: $375.00

Do you have more transactions? y

---------------------------------------------------------------------------------

Are you making a deposit or a withdrawal? w

What months, day, and year is it (ex 9 30 2020): 9 30 2020

It is 9/30/2020

How much is your withdrawal? 350.00

Your current balance is: $25.00

Warning: Your balance is below $50.00!

Do you have more transactions? y

---------------------------------------------------------------------------------

Are you making a deposit or a withdrawal? w

What months, day, and year is it (ex 9 30 2020): 9 30 2020

It is 9/30/2020

How much is your withdrawal? 100.00

Your current balance is: $-75.00

Warning: Your balance is below $50.00!

The following service charge was deducted from your account: $25.00

Do you have more transactions? y

---------------------------------------------------------------------------------

Are you making a deposit or a withdrawal? w

What months, day, and year is it (ex 1 10 2020): 1 10 2020


It is 1/10/2020

How much is your withdrawal? 100.00

Your current balance is: $-200.00

Warning: Your balance is below $50.00!

The following service charge was deducted from your account: $25.00

Do you have more transactions? n

---------------------------------------------------------------------------------

Do you have more transactions? n

Thank you for using HSBC Bank Canada.

You might also like