#include
#include
#include
struct student
{
char name[20];
char matric[30];
char fakulti[20];
char course[20];
float paymentamount;
float lastamount;
float currentamount;
float insurans;
};
void studentinformation(struct student studentlist[]);
void paymentstudent(struct student studentlist[]);
void insuransstudent(struct student studentlist[]);
int i;
void main()
{
struct student studentlist[1];
studentinformation(studentlist);
paymentstudent(studentlist);
insuransstudent(studentlist);
}
void studentinformation(struct student studentlist[])
{
printf("\n\n\t******Student Course Payment******");
for(i=0;i<1;i++){
printf("\n\n\tEnter Your Name : ");
gets(studentlist[i].name);
printf("\tEnter Your Matric Number : ");
gets(studentlist[i].matric);
printf("\tEnter Name Of Falkulti : ");
gets(studentlist[i].fakulti);
printf("\tEnter Your Course : ");
gets(studentlist[i].course);
printf("\tEnter Your Payment Amount All Semester : ");
scanf("%f",&studentlist[i].paymentamount);
printf("\tEnter Your Last Amount : ");
scanf("%f",&studentlist[i].lastamount);
printf("\tEnter Your insurans payment Per Semester : ");
scanf("%f",&studentlist[i].insurans);
getc(stdin);
}
}
void paymentstudent(struct student studentlist[])
{
float total,total_payment,total_last;
printf("\n\n\t******Update Student Course Payment******");
for(i=0;i<1;i++){
printf("\n\n\t*************************");
printf("\n\tName :%s",studentlist[i].name);
printf("\n\tMatric :%s",studentlist[i].matric);
printf("\n\tFakulti :%s",studentlist[i].fakulti);
printf("\n\tCourse :%s",studentlist[i].course);
printf("\n\tPayment Amount :RM%.02f",studentlist[i].paymentamount);
printf("\n\tLast Amount :RM%.02f",studentlist[i].lastamount);
printf("\n\t*************************");
total_payment=studentlist[i].paymentamount;
total_last=studentlist[i].lastamount;
total= total_payment-total_last;
studentlist[i].currentamount=total;
printf("\n\n\tTotal Current Amount :RM%.02f",studentlist[i].currentamount);
getch();
}
}
void insuransstudent(struct student studentlist[])
{
float ins,sumins,total_payment;
printf("\n\n\t****Update Student Payment After Include With insurans****");
for(i=0;i<1;i++){
printf("\n\n\tinsurans payment :RM%.02f",studentlist[i].insurans);
printf("\n\tCurrent Amount :RM%.02f",studentlist[i].currentamount);
ins=studentlist[i].insurans;
sumins=studentlist[i].currentamount;
total_payment=ins + sumins;
studentlist[i].insurans=total_payment;
printf("\n\tTotal Payment :RM%.02f",studentlist[i].insurans);
getch();
}
}
kalo u all tengok mesti nampak macam susah tapi bila dah paham senang jer..tapi yang pelik nya aku x penah nak paham2 hahaha ngongek kan huhu...hoow eveerr kenapa kawan2 gua yang amik test malam nie good luck!!! daaa