Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C Language (MUST contain loops and function)to Compute Interest Charges: an example of credit card and interest: Initially owe $1.00 At the end of

Using C Language (MUST contain loops and function)to Compute Interest Charges:

an example of credit card and interest:

Initially owe $1.00

At the end of the month owe $1.00 plus $0.01

At the end of the next month owe $1.01 plus $0.0101

Here is an equation: d=u+p+((u+p)*i)-r Note: d is the amount due at the end of the month, u is the previous unpaid amount due, p are the purchases for that month, r is the amount repaid that month, i is the interest rate per month. Calculated "d" becomes the new "u" for the next month.

Not consider penalties or special charges or minimum payments. And there could be an amount owing already on the card at the beginneing of the period we compute.

Restrictions: 1) If owe any money at the start of a month, you pay interest on the amount owed plus any amount purchased in that month. Any unpaid amount plus interet after any payment becomes the owed amount at the start of the next month. 2) If don't owe any money at beginning of a month, but don't pay off all purchases, you pay interest on the entire amount of purchase. The unpaid amount plus interest after any payments becomes the owed amounf at the start of the next month. 3) If don't owe any money at beginning of a month, and pay off all purchase at the end of the month, you pay NO interest and do not owe money at the start of the next month.

Requirement: The user will enter the inital amount owed on the card, purchase amount per month, the payments per month, the yearly interst rate (the monthly rate will be 1/12 of this) and the number of months to be considered for the calculations. Only month is integer, others are double.

Must use this prototype as function:

double owedAmount (double interest, double owedFromPreviousMonth, double purchases, double monthlyPayment);

An example:

Enter amount already owed: 23 Enter purchase amount per month: 17 Enter payment amount per month: 800 Enter yearly interest rate as percent: 33 Enter number of months to consider: 19 Total interes value: 1.1

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions