Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help write this program using C++ Create and test the following functions in the checkingmodule.cpp file. Remember to add the function declarations to the

Please help write this program using C++ image text in transcribed
image text in transcribed
Create and test the following functions in the checkingmodule.cpp file. Remember to add the function declarations to the header file. Make sure you test each function. MainMenu function takes no arguments, but returns a single character either D, W, L, or Q. This function should continually output the options to the user, once the user enters D, W, Lor Q then it returns the valid choice. You will need to add the include iostream, string and use namespace std at the top of checkingmodule.cpp. GetValue function takes one argument a string that is displayed to the user to ask them for input. The function returns a float. It should continually ask the user for an amount by showing them the prompt passed in, it must be greater than 0. It should return the selected amount. GetValue overload function takes two arguments a string to display to the user to ask for input and an upper limit. It returns a float. It should ask the user for an amount to withdraw. The amount must be greater than O and less than the argument. It should then return the selected amount GetinterestRate function takes one argument an integer which is their credit score, and returns a float the amount of interest they will be charged. If the credit score is 500 or lower, they will be charged 5% interest, or 0.05. If the credit score is greater than 500 and less than or equal to 700 then they will get 3% interest. If their credit score is greater than 700, then the interest rate is 1%. Withdraw function that takes 2 arguments, an amount value passed by reference that is the users account balance, and amount to withdraw. It should not return any value, but should only decrement the account balance by the amount. GetLoanMonths function that takes no arguments and continually prompts the user for number of months for the loan until they give a valid #. Valid loan amount in months is 12, 24, 36 and 60. i. ii. ili. iv. v. vi. vili. GetCreditRating function takes no arguments and returns an integer from 300 to 850 inclusive. It should prompt until the user chooses a valid value. vii. CalculateLoanAmount function takes arguments, Principal a float, interest rate a float, and the number of months of the loan as an integer, and returns the calculated loan amount. The formula for Amount is months Amount= Principal(1 +rw, rate 12 You can use the pow function, which takes 2 arguments. pow(2, 5) returns 2 to the 5th power. OutputAccount function takes one argument an amount, and outputs the amount in the account. (Get creative in making it look nicel.) ix. Once the functions are written and you have tested to make sure they work correctly, write a program to run until the user chooses quit, and keeps track of the amount they have in their account. It should start out with the account amount at zero. e. (D)eposit, (b)ithdrawa 1, ( )oan or (QJuit os murh do you want to deposit? >s ou must enter an omount greater than ow murh do you want to deposit? > 288 200 usnary of Account Asount 5200 loin Nenu Enter one of the fullowing ) (D)eposit, (W)ithdronal, (Loan or (Q)uit low nuch do you want to withdrau? 250 ou nust enter an arount less than or equal to 200 ow much do you want to withdraw? 20 uemary of Account Anount $180 ain Menu Enter one of the following) (Deposit, () thdraval. (Leen or (Quit Main Menu (Enter one of the following) (D)eposit, (W)ithdraial, (L)oan or (Quit dhat is your credit rating? [300, 850] 0 ou nust choose a value from 300 850 inclus ive that is your credit rating? 1300, 850 40 nany months for the loan? 12, 24, 36 or 60>90 ou You nust enter 12, 24, 36 or 68 only low eany months for the loan? 12, 24, 36 or 60 60 fow euch do you want to borrow? 10000 Interest Rate : .05 rincipal10000 onths 60 our total loan amount is 10210.1 ain Henu Enter one of the following) (D)eposit, (W)ithdrawal, (L)oan or (Q)uit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions