Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem : Create a program to calculate how many months it will take to pay off a credit card given current credit card balance, annual

Problem: Create a program to calculate how many months it will take to pay off a credit card given current credit card balance, annual percentage rate, the monthly payment amount. Add 10% to the monthly payment and recalculate the number of months. Report the results in a table. Use top down design modular design methodology

Input: Prompt for

  • the clients name

  • the current credit card balance

  • the Annual Percentage Rate (APR)

  • the amount of money you can be paid monthly.

Formula:

n = log10(1 (Ai/P))/log10(1 + i)

Where,

n = Number of Months to payoff credit card

A = Amount on credit card

i = Monthly Rate (APR / 12)

P = Monthly Payment Amount

Constraints:

  • Enter the APR as an integer. A 22% interest rate would be entered as 22. Have the program convert this to the correct rate: 0.22.

  • Display the payoff months as a whole number - fractional months dont make sense.

  • Use the literal MONTHS_IN_YEAR rather than 12 in formulas requiring the number of months (if you need any).

  • Keep the Input, Processing, and Output sections of your code separate, use modular hierarchical design.

  • Design functions to

  • prompt and read client name

  • prompt and read API

  • prompt and read monthly payments

  • prompt and read current credit card balance

  • calculate the number of months (using helper functions as needed)

  • display the results in a tabulated form.

  • Use the appropriate C++ libraries for the log() function. Select the appropriate log function

  • This program will be menu driven it will repeatedly ask the user to enter data and will terminate when the user enters N. Please see the program output in the testing and verification section to get an idea of the menu and behavior.

  • Input Validation: You are expected to do simple input validation. Some C++ functions that can be helpful to for this purpose are

  • You will need to include the iomanip library for output formatting. Use three decimal places of precision.

  • You will also need the strings library.

  • You are required to test your program thoroughly and provide snapshots of evidence that your program passes the above tests successfully. You need to provide screenshot evidence of this as given above in the testing and verification section. Here are the six testing sequences that you are required to provide evidence for: The first three test that with given valid inputs, your program calculates and displays the output accurately as per specification. The next three sequences test if the program does input validation for balance, API and monthly payments respectively. In these last cases, when an invalid input is entered, the program should indicate an error and loop back to the main menu. The program should terminate when the user chooses to exit by entering n. Note that the program should not be case sensitive and accept both Y/N and and y /n.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions