In this I will let you know how to write a program that manage school without using any complication . So , without wasting our let's get started . First I show you code then we come to explanation .
Code:
#include <stdio.h>
//School fees management program using C languag
int main()
{
//For Students Details
char SchoolName[30];//School Name
char Date[10];//To get date
int Eno; //Student Enrollement
char Sname[20]; //Student Name
char Fname[20]; //Student's Father's Name
char Mname[20]; //Student's Mother's Name
char C_S[10]; //Class and Section
//Now for fees details
int CMF; //Consoliated Monthly fees
int R_f; //Readmission and fine
int Conveyance;//If you use bus
int Tfess;//Term fees
int Cfess;//Computer fees
int Exam;//Exam fees
int Rfess;//Registration fees
int Afess;//Admission fees
int concession;//Concession fees
int grTotal;//grand Total
printf("Enrollenment no.\n");
scanf("%d",&Eno);
printf("School name\n");
scanf(" %[^\n]s",SchoolName);
printf("Date\n");
scanf(" %[^\n]s",Date);
printf("Student name\n");
scanf(" %[^\n]s",Sname);
printf("Father's Name\n");
scanf(" %[^\n]s",Fname);
printf("Mother's Name\n");
scanf(" %[^\n]s",Mname);
printf("Class & section\n");
scanf(" %[^\n]s",C_S);
printf("Consilated Monthly Fees:\n");
scanf("%d",&CMF);
printf("Readmission/Fine: \n");
scanf("%d",&R_f);
printf("Conveyance: \n");
scanf("%d",&Conveyance);
printf("Term Fees: \n");
scanf("%d",&Tfess);
printf("Computer fees: \n");
scanf("%d",&Cfess);
printf("Exam fees: \n");
scanf("%d",&Exam);
printf("Registration Fees: \n");
scanf("%d",&Rfess);
printf("Admission Fees :\n");
scanf("%d",&Afess);
printf("Concession: \n");
scanf("%d",&concession);
grTotal=(CMF+R_f+Conveyance+Tfess+Cfess+Exam+Rfess+Afess)-(concession);
//Grandtotal is sum of all subract concession
printf("Date:%s School Name :%s\n",Date,SchoolName);
printf("Enrollement No.%d Student Name:%s Class & Section: %s\n",Eno,Sname,C_S);
printf("Father's Name:%s Mother's Name:%s\n",Fname,Mname);
printf("------------------------------------------------------------------------------\n");
printf("Consilated Monthly Fees : %d\t\t Readmission/fine :%d\n",CMF,R_f);
printf("Conveyance fees :%d\t\t Term Fees : %d\n ",Conveyance,Tfess);
printf("Computer fees : %d \t\t Exam fees :%d\n",Cfess,Exam);
printf("Registration fees : %d \t \t Admission fees :%d\n ",Rfess,Afess);
printf("Concession : %d\n");
printf("----------------------------------------------------------------------------------\n");
printf("Grand Total : %d \n",grTotal);
return 0;
}
Logic:
Here we first declare the variables for the details of the students . Namely SchoolName , Date, Sname(Student's Name), Fname(father's Name), Mname(mother's Name), C_S(class & section) of type character array(String) and Eno(Enrollement No) of type int. And then we define variables for fees details of the students . I just define variables for only few important fees details you can customize it according to yours . Here two important variables is necessary that is grTotal(grand Total) of fees and Concession . And then we take input to these variables for int data type taking input is easy . And for String we take input using special method About input in String . And then we do grandTotal of fees by adding other charges and subtract concession from it . And then we just use printf statement and to show user fees summary of student.
Output:
here you can see that we give input as required . And then we get our desired output . This tells us that our program work properly. Try this by self by changing the variables . Please provide feedback this code by commenting your views. I hope this is helpful in your work . Thanks for reading.
No comments:
Post a Comment