Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4.23 (Calculating the to calculate the compound interest. [Hint: Treat all monetary amounts as integral numbers of pennies. Then break the result into its dollar

image text in transcribed

4.23 (Calculating the to calculate the compound interest. [Hint: Treat all monetary amounts as integral numbers of pennies. Then "break" the result into its dollar portion and cents portion by using the division and remainder operations, respectively. Insert a period. Interest with Integers)Modify the program of Fig. 4.6 so that it uses only integers I Fig. 4.6: ig04 06.c 2 Calculating compound interest 3 #include #include 6 int main(void) double principal 1000.0; /starting principal double rate 05; / annual interest rate 10 // output table column printf("%45%21s ", heads "Year", 12 "Amount on deposit"); 13 14 1s for (unsigned int year 1; year10; +year) 16 17 18 calculate amount on deposit for each of ten years calculate new amount for specified year double amount principalpow(1.0rate, year) 20 // output one table row printf("%4uS2 1.2f ", year, amount); 23 Year Amount on deposit 1050.00 1102.50 1157.63 1215.51 1276.28 1340.10 1407.10 1477.46 1551.33 1628.89 10 Fig. 4.6 Calculating compound interest

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions