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); } } }
6 Antworten
+ 3
Show us your attempt
+ 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
+ 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?
+ 2
Why not Python ?????
0
then wait for 12 hours 😇😊
0
try it bro it is a simple one you can do it in python as well :)