write a algorithm for one college the tuition for a full-time student is $8,000 per semester. it has been announced that the tuition will increased my 3 percent each year for the next 5 years. write a program with a loop that displays the projected semester tuition amount for the next 5 years
here i have written the C program:
Algorithm:
Start:
Step1: Calculate Annual fee as 2*sem_fee
Step2: Print the first year fee without increment
Step3: Loop for 5 times from year 1 to 5
Step4: annual_fee = annual_fee + annual_fee * 0.03
Step5: Print each year fee with the incrment
Stop
=================================================================
Program:
#include<stdio.h>
int main()
{
//stf = semester tution fee
double stf=8000;
double annual_fee=2*stf;
printf("Year 1 fee = %0.2lf\n", annual_fee);
for(int i = 2; i <=6; i++)
{
annual_fee = annual_fee + annual_fee * 0.03;
printf("Year %d fee = %0.2lf\n", i, annual_fee);
}
return 0;
}
=================================================================
Sample Output:
==================================================================
Kindly Check and Verify Thanks...!!!
Get Answers For Free
Most questions answered within 1 hours.