I've just started a C++ programming class and I need to write a program to total up one day's worth of bank activity with a small percentage, but I don't know where to even start. Here's the problem summary:
The Silly Savings and Loan Company just opened up with a cash balance of $1000, and a plan to get rich. Their plan to make money is simple. They will charge no fee for checks, and a 3% fee for all deposits. You will write a program for them. They will run your program and enter deposits as positive numbers, and checks as negative numbers. All transactions will be recorded in the order they happen. When they run out of things to enter at the end of the day, they will enter a value of 0 to stop the program.
The program needs to add up both sets of numbers (deposits and checks) and figure out the amount of cash they should have at the end of the day. For every deposit, the 3% fee will be removed from the amount actually deposited, that amount will be added in to the profit they expect to make.
Once the data entry has been completed, the program will print out the total amount of checks written (as a positive number), the total amount of deposits received, the amount of cash they should have on hand, and the total profit earned that day.
Here are the transactions for their first day of operation:
Deposit 100.00
Check 500.00
Deposit 250.00
Deposit 25.00
Check 75.50
Deposit 27.50
Check 775.27
Could anyone help get me started? I know I'm going to need several variables, while loop, decision, input, and assignment statements.
#include <iostream>
usingnamespace std;
int main()
{
boolcontinue = true; // this variable is so we don't need to know how many transactions we have
string operation;
double value; // the value of the transaction, which will be handled differently because of Operation.
double balance = 1000.0; // the starting balance indicated by the problem
int countChecks = 0; // a counter variable for the checks
int countDeposits = 0; // a counter variable for the deposits.
double depositFee = 0.03; // the deposit fee for some math.
while(continue == true)
{
cout << "Please Enter the Type of operation: ";
cin >> operation;
cout >> "Please Enter the amount of transaction: ";
cin >> value;
// we have a decision based on Operation, where we will do some math on balance.
// we will ask if we have more transactions, simple yes or no.
// if no we need to set continue to false.
} // end the while
return 0;
} // end of main.
My stuff isn't like your problem exactly but you have an idea. Read your problem to make accurate changes.