In 2020 the average cost of living/month (excluding housing) for a family of 4 in Pittsburgh was $3850 per month. Write a program to print the first year in which the cost of living/month is over $4450 given that it will rise at a rate of 2.1% per year. (Note: this program requires no input). Upload this program during class.
Can only use while loops not For loops
ASAP Please
`Hey,
Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.
year=2020;
sum=3850;
while(sum<4450):
sum=1.021*sum;
year+=1;
print("Year at which it will cross is",year);
Kindly revert for any queries
Thanks.
Get Answers For Free
Most questions answered within 1 hours.