Write a program that uses a loop to display the projected rates for the next six years. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a program that uses a loop to display the projected rates for the next six years.

A country club, which currently charges 2500$ per year for membership, has announced it will increase its membership fee by 4% each year for the next 6 years. Solution: package membership; public class Membership { public static void main(String[] args) { int fee=2500; for (int i=1;i<7;i++) { fee+=(2500*0.04); System.out.println("Year "+i+" membership fee: "+fee); } } }

20th Sep 2018, 5:45 PM
Uzair Saeed
Uzair Saeed - avatar
6 Answers
+ 3
Show us your attempt
20th Sep 2018, 5:56 PM
blACk sh4d0w
blACk sh4d0w - avatar
+ 3
a=2500 percent=(a*(4/100)) for i in range(1,6+1): percent+=percent print('Fee for', i ,' year is ',a+percent) Far easy......👍👍👍 Try out in Python console
20th Sep 2018, 6:29 PM
OM KASHYAP
OM KASHYAP - avatar
+ 2
int fee = 2500; for (int i = 0; i<6; i++) { System.out.println((i + 1) + ". year's fee: " + fee + "
quot;); fee = 2500*(1+0,04); } is this what you've asked for?
20th Sep 2018, 6:01 PM
Shadowa
Shadowa - avatar
+ 2
Why not Python ?????
20th Sep 2018, 6:25 PM
OM KASHYAP
OM KASHYAP - avatar
0
then wait for 12 hours 😇😊
20th Sep 2018, 5:57 PM
Uzair Saeed
Uzair Saeed - avatar
0
try it bro it is a simple one you can do it in python as well :)
20th Sep 2018, 6:27 PM
Uzair Saeed
Uzair Saeed - avatar