xxxxxxxxxx
//Write a program that computes and assesses the tuition fee of the students in one trimester,
//based on the given mode of payment below.
//Plan(key): (1)Cash (2)Two-Installment (3)Three-Installment
//Discount(-) or Interest(+): 10% Discount, 5% Interest, 10% Interest
//The target-user must use the key in selecting or choosing the mode of payment.
//The first input data is the tuition fee, and the second input data is the mode of payment.
#include<stdio.h>
main()
{
float tf,mop,ttf,d,i;
printf("\nEnter tuition fee: ");
scanf("%f",&tf);
printf("\nSelect the desired key number below");
printf("\n(1)Cash (2)Two-Installment (3)Three-Installment");
printf("\n\nEnter mode of payment: ");
scanf("%f",&mop);
if(mop==1)
{
d=tf*0.10;
ttf=tf-d;
printf("\nThank you for choosing cash method!");
printf("\nYou have 10% discount.");
printf("\nYour total tuition fee is: %f\n",ttf);
}
else if(mop==2)
{
i=tf*0.05;
ttf=tf+i;
printf("\nYour total tuition fee is: %f\n",ttf);
}
else if(mop==3)
{
i=tf*0.10;
ttf=tf+i;
printf("\nYour total tuition fee is: %f\n",ttf);
}
else
printf("\n\nERROR VALUE!\n");
}
xxxxxxxxxx
#include<stdio.h>
main()
{
int grade;
printf("\nEnter Grade: ");
scanf("%d",&grade);
if(grade>=90&&grade<=100)
printf("\nGrade = A\n");
else if(grade>=80&&grade<=89)
printf("\nGrade = B\n");
else if(grade>=70&&grade<=79)
printf("\nGrade = C\n");
else if(grade>=60&&grade<=69)
printf("\nGrade = D\n");
else if(grade>=50&&grade<=59)
printf("\nGrade = E\n");
else printf("\nOUT OF RANGE!\n");
}