0% found this document useful (0 votes)
2 views1 page

Struct Student Array Three - CPP

The document is a C++ program that manages student fee information. It allows users to input data for multiple students, including admission number, name, number of units, and fee paid, and calculates the fee balance. Finally, it outputs the entered data and fee analysis for each student.

Uploaded by

babyn5941
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Struct Student Array Three - CPP

The document is a C++ program that manages student fee information. It allows users to input data for multiple students, including admission number, name, number of units, and fee paid, and calculates the fee balance. Finally, it outputs the entered data and fee analysis for each student.

Uploaded by

babyn5941
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

#include<iostream>

using namespace std;


const double FEE_PAYABLE = 90000;
struct Student
{
char adm_no[20],name[25];
int no_of_units;
double fee_paid, fee_balance;
};
int main()
{
Student *stud; //Dynamic Array
int i, total_number;

cout<<"How many students do you want to work with? ";


cin>>total_number;

stud = new Student[total_number];

for(i = 0;i < total_number;i++)


{
cout<<"\n\nData entry for the student "<<(i + 1)<<":\n"
<<"------------------------------------------------------------\
n";
cout<<"Enter the admission number of the student: ";
cin>>stud[i].adm_no;
cout<<"Enter his/her name: ";
cin>>stud[i].name;
cout<<"Enter the number of units he/she is doing: ";
cin>>stud[i].no_of_units;
cout<<"Enter fee he/she has paid: ";
cin>>stud[i].fee_paid;

stud[i].fee_balance = FEE_PAYABLE - stud[i].fee_paid;


}

for(i = 0;i < total_number;i++)


{
cout<<"\n\nAnalysis for the student:"
<<"\n---------------------------------------";
cout<<"\nAdmission Number: "<<stud[i].adm_no
<<"\nName: "<<stud[i].name
<<"\nNumber of Units: "<<stud[i].no_of_units
<<"\nFee Paid: "<<stud[i].fee_paid
<<"\nFee Balance: "<<stud[i].fee_balance;
}

cout<<"\n\n";
return 0;
}

You might also like