Computer Science, asked by Anonymous, 5 months ago

Suppose that the tuition for a university is RM5000 this year and increase 2.5% every
year. Write segment codes in Java that displays the tuition for the next four years. The output
is in two decimal point

Answers

Answered by tanusrig235
3

Since you want to increase the amount 5% every year, instead of having rate = 5

You should have rate = 1.05.

With the rate as 1.05 you can do this

FeeAtYear1 = 10000*1.05^0 = 10000

FeeAtYear2 = 10000*1.05^1 = 10500

FeeAtYear3 = 10000*1.05^2 = 11025

FeeAtYear4 = 10000*1.05^3 = 11576.25

...

FeeAtYear10 = 10000*1.05^9 = ~16288.95

You don't even need a while loop.

TotalCost = 10000 *1.05^10 + 10000 *1.05^11 + 10000 *1.05^12

Answered by rajputravisingh499
1

पृथ्वी की चुंबकीय क्षेत्र पृथ्वी की घूर्णन अक्ष से कितना कोण बनाती है.???

Similar questions