0% found this document useful (0 votes)
68 views

Program 1: Program To Create A Class For Entering and Displaying Student Details

This C++ program defines a class called ADMISSION to store and display student details. The class contains data members for admission number, name, class, and fees. Member functions Read_Data() and Display() are used to input student data and output the stored details respectively. The main() function creates an object of ADMISSION, calls the member functions to enter and then display the student information.

Uploaded by

Tanishq Kapoor
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

Program 1: Program To Create A Class For Entering and Displaying Student Details

This C++ program defines a class called ADMISSION to store and display student details. The class contains data members for admission number, name, class, and fees. Member functions Read_Data() and Display() are used to input student data and output the stored details respectively. The main() function creates an object of ADMISSION, calls the member functions to enter and then display the student information.

Uploaded by

Tanishq Kapoor
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PROGRAM 1

PROGRAM TO CREATE A CLASS FOR ENTERING AND DISPLAYING STUDENT DETAILS


#include<iostream.h>
#include <conio.h>
#include <stdio.h>
class ADMISSION
{
int AD_NO;
char NAME[20];
int CLASS;
float FEES;
public:
void Read_Data()
{
do
{
cout << "Enter admission no.(11-1999) : ";
cin >> AD_NO;
}while (AD_NO<10 || AD_NO>2000);
cout << "Enter name : ";
gets(NAME);
cout << "Enter class : ";
cin >> CLASS;
cout << "Enter fees : ";
cin >> FEES;
}
void Display()
{
cout<<"\n\nDetails of student are ::\n ";
cout << "Admission no. : " << AD_NO << endl;
cout << "Name : " << NAME << endl;
cout << "Class : " << CLASS << endl;
cout << "Fees : " << FEES << endl;
}
};
void main()
{ clrscr();
ADMISSION adm;
adm.Read_Data();
getch();
adm.Display();
getch();

}
OUTPUT

You might also like