A bank in your town updates its customers accounts at the en

A bank in your town updates its customers\' accounts at the end of each month. The bank offers two types of accounts: savings and checking. Every customer must maintain a minimum balance. If a customer\'s balance falls below the minimum balance, there is a service charge of $10.00 for savings accounts and $25.00 for checking accounts. If the balance at the end of the month is at least the minimum balance, the account receives interest as follows:

Write a program that reads a customer\'s account number (int type), account type (char s for savings, c for checking), minimum balance that the account should maintain, and current balance. The program should then prints a report with (1) an appropriate heading and (2) that shows the account number, account type, and current balance for each customer in the file.

your output should look like

Test your program by running it on the five accounts, using the
following data file name \"infile.txt\":

you must read the data from the file cost must be done in c++ we cant use switch case loops or anything everyting must be done using function prototypes and value returning functions and everything must be printed from a void function please the data above must be read from a file we are not getting input from the user data must be read from file pleasee try to read the intrsuctions thak you!

main Acct type Acct type balance Acct Acc no Acct minimu balance ce Acc type charge minimum balance balance Compute Print Acct Service balance report charge interest Compute interest

Solution

#include <iostream>
#include<fstream>
#include <sstream>
using namespace std;
int balance(string acct,int value2, int value3);
int main() {

cout << \"Reading from the file\" << endl;
string name,acct,v4;


ifstream myfile(\"infileZZ.txt\", ifstream::in);
int v1,v2,v3,value1,value2,value3;
while(myfile >> value1>>name>>value2>>value3){
cout<<\"****************************************\"<<endl;
cout << value1<<\" \"<<name<<\" \"<<value2<<\" \"<<value3<<endl;
v1=value1;
v2=value2;
v3=value3;
v4=\"Saving\";

}
myfile.close();
int b=balance(v4,v2,v3);
cout << \"Balance\"+b<<endl;

return 0;
}

/* void accType(String name){
if(name.find(\"S\")){
acct=\"Saving\";
}
else
{acct=\"Checking\";
}}*/
int balance(string acct,int value2, int value3){
int interest=0;
int fine=0;
cout<<\"Here 1\"<<endl;
if(acct==\"Saving\")
{ //saving
cout<<\"Here 2\"<<endl;
if(value3<value2){
fine=-10;
}
else{
interest=0.04*value3;
}
value3=value3+fine+interest;
cout<<\"Here 3\"+value3<<endl;

}
else {//checking
if(value3<value2){
fine=-25;
}
else{
if(value3-value2>5000)
interest=0.05*value3;
else {
interest=0.03*value3;
}
}
value3=value3+fine+interest;
}
return value3;
}

A bank in your town updates its customers\' accounts at the end of each month. The bank offers two types of accounts: savings and checking. Every customer must
A bank in your town updates its customers\' accounts at the end of each month. The bank offers two types of accounts: savings and checking. Every customer must

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site