Question
Hi Guys I would like to have some help with the following. I want to keep the same code, but i have to add in
Hi Guys I would like to have some help with the following. I want to keep the same code, but i have to add in the ability to save and retrieve data in the code, as well as a hierarchy chart. Below is my command. // --------------------------------------------------------------- // Programming Assignment: Course Project 06 // Developer: ______Jay Tschoepe________________ // Date Written: _____08-16-18_________________ // Purpose: Loan Calculator // --------------------------------------------------------------- //inclusions #include #include #include using namespace std; void initFormatting(); void printInterfaceMessage(); void processUserRequest(); void validateUserInput(); void calculateMonthlyBalance(); int main() { initFormatting(); printInterfaceMessage(); processUserRequest(); return 0; } void initFormatting() { cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(2); } void printInterfaceMessage() { //input cout << "Welcome to national Bank " << endl; cout << "We are pleased in assisting you in your banking needs" << endl; cout << "Menu" << endl; cout << "Want to start or do you want to quit?" << " Enter '1' for start, or '2' to quit." << endl; } void processUserRequest() { int answer_1; char ch='y'; char menu[2][100] = { "Menu: Start Process (s) " , "Menu: Quit the Process (q) " }; while (true) { cin >> answer_1; if ( answer_1 >2) { cout << "Menu "; cout << " Enter '1' for start, and time 2. quit "; } else { break; } } if (answer_1 == 1) { cout << "We are Open to start at this time " << endl; while (ch == 'y' || ch == 'Y') { for (int i = 0; i < 2; i++) { cout << (i + 1) << ". " << menu[i] << endl; } validateUserInput(); calculateMonthlyBalance(); cout << "Press Enter to end -->" << endl; } system("pause"); } } void validateUserInput() { int choiNos[2] = { 1, 2 },choice; while (true) { bool valid = false; cout << endl << "Please enter your choice number : "; cin >> choice; for (int i = 0; i < 2; i++) { if (choiNos[i] == choice) { valid = true; break; } } if (!valid) { cout << "Invalid entery!" << endl; continue; } break; } } void calculateMonthlyBalance() { double monthlyPayment; double interestRate; double loanAmount; double month = 0; double balance; cout << "Enter the current balance of your loan: $"; cin >> loanAmount; cout << "Enter the interest rate : "; cin >> interestRate; cout << "Enter the monthly payment : $"; cin >> monthlyPayment; while (interestRate >= 1) { interestRate = interestRate / 100; } //calulations balance = loanAmount* (1 + interestRate / 12) - monthlyPayment; cout << "month 1 your balance is $" << balance << endl; while (balance > 0) { balance = balance * (1 + interestRate / 12) - monthlyPayment; month = month++; //output cout << " month " << month << ", your balance is : $" << balance << endl; } system("pause"); } If anyone can help that is greatly appreciated.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started