Question: Hello my C + + program wontt run & i can figure out why. Could you help me #include #include using namespace std; int readAccountNo

Hello my C++ program wontt run & i can figure out why. Could you help me
#include
#include
using namespace std;
int readAccountNo(){
int accNo;
do {
cout << "Enter an account number (even, positive, less than 10000): ";
cin >> accNo;
} while (accNo %2!=|| accNo <=|| accNo >=10000);
return accNo;
}
double readBalanceAmount(){
double balance;
do {
cout << "Enter the opening balance amount ($1- $200000): ";
cin >> balance;
} while (balance <1|| balance >200000);
return balance;
}
double calculateDeposit(double balance){
double deposit;
cout << "Enter the amount to deposit: ";
cin >> deposit;
return balance + deposit;
}
double addReturnBonus(double openingBalance){
double bonusPercentage =3.5;
double bonus =(bonusPercentage /100)* openingBalance;
return openingBalance + bonus;
}
void printAllInfo(int accNo1, double balance1, int accNo2, double balance2, int accNo3, double balance3, int accNo4, double balance4){
cout << fixed << setprecision(2);
cout << "Account Balances for All Accounts:" << endl;
cout << "Account Number: "<< accNo1<<"\tBalance: $"<< balance1<< endl;
cout << "Account Number: "<< accNo2<<"\tBalance: $"<< balance2<< endl;
cout << "Account Number: "<< accNo3<<"\tBalance: $"<< balance3<< endl;
cout << "Account Number: "<< accNo4<<"\tBalance: $"<< balance4<< endl;
}
int main(){
cout << "Developer's Details:" << endl;
for (int i =1; i <=3; i++){
cout << "Name: [Your Name]"<< endl;
cout <<"CPS 171 Section: [Your Section]"<< endl;
cout << "Due Date: [Due Date]"<< endl;
}
int account1, account2, account3, account4;
double balance1, balance2, balance3, balance4;
cout << "Enter data for 4 customers:" << endl;
for (int i =1; i <=4; i++){
cout << "For customer "<< i <<":"<< endl;
if (i ==1){
account1= readAccountNo();
balance1= readBalanceAmount();
} else if (i ==2){
account2= readAccountNo();
balance2= readBalanceAmount();
} else if (i ==3){
account3= readAccountNo();
balance3= readBalanceAmount();
} else {
account4= readAccountNo();
balance4= readBalanceAmount();
}
}
balance1= addReturnBonus(balance1);
balance2= addReturnBonus(balance2);
balance3= addReturnBonus(balance3);
balance4= addReturnBonus(balance4);
char choice;
do {
cout << "Main Menu:" << endl;
cout <<"A- Do deposit" << endl;
cout <<"B- View accounts" << endl;
cout <<"C- Exit the program" << endl;
cout << "Enter your choice: ";
cin >> choice;
switch(choice){
case 'A':
cout << "Select an account to do a deposit:" << endl;
// Implement deposit functionality for selected account
break;
case 'B':
printAllInfo(account1, balance1, account2, balance2, account3, balance3, account4, balance4);
break;
case 'C':
cout << "Exiting the program. Goodbye!" << endl;
break;
default:
cout << "Invalid option. Please choose a valid option (A, B, or C)."<< endl;
}
} while(choice !='C');
return ;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!