Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

LAB TASK 10

TAJAMMUL LATIF
(19-SE-74)

OUTPUT:
C++ CODING:
#include<iostream>
#include<conio.h>
#include<stdlib.h>
#include<iomanip>
#include<windows.h>
using namespace std;

struct student
{
char roll_Number[20] = "0" ;
int pf_Score=0;
};

int main()
{
int i, j;
student s1, s2, s3, r1, r2, r3;
do
{
MAIN:
cout << "\n\t\t\t\t<--------{ Main Menu }--------->\n";
cout << "\n\t\tPress 1 to Enter student Record ";
cout << "\n\t\tPress 2 to display student Record ";
cout << "\n\t\tPress 3 to Exit..... ";
cout << "\n\n\t\tChoose your Option : ";
cin >> i;
if( i== 1)
{
cout << "\n\t\tPress 1 for 1st student Record";
cout << "\n\t\tPress 2 for 2nD student Record";
cout << "\n\t\tPress 3 for 3rD student Record";
cout << "\n\t\tPress 4 for return to main menu";
cout << "\n\t\tPress 5 to Exit.....";
OPTION:
cout << "\n\n\t\tChoose your Choice : ";
cin >> j;
if( j == 1 )
{
cout << "\n\t\t\t\t<--------{ 1st Student Data }--------->";
cout << "\n\n\t\tEnter Reg_No : ";
cin >> s1.roll_Number;
cout << "\n\t\tEnter PF Marks : ";
cin >> r1.pf_Score;
goto OPTION;
}
else if( j == 2 )
{
cout << "\n\n\t\t\t\t<--------{ 2nD Student Data }--------->";
cout << "\n\t\tEnter Reg_No : ";
cin >> s2.roll_Number;
cout << "\n\t\tEnter PF Marks : ";
cin >> r2.pf_Score;
goto OPTION;
}
else if( j == 3 )
{
cout << "\n\t\t\t\t<--------{ 3rD Student Data }--------->";
cout << "\n\n\t\tEnter Reg_No : ";
cin >> s3.roll_Number;
cout << "\n\t\tEnter PF Marks : ";
cin >> r3.pf_Score;
goto OPTION;
}
else if( j == 4 )
{
goto MAIN;
}
else if( j == 5 )
{
exit(0);
}else
cout << "\n\n\t\tInvalid choice. \n\n\t\t";
system("pause");
system("cls");
goto MAIN;

}else if( i == 2)
{
cout << "\n\t\t Roll No." << setw(25) << "PF Score\n\n" ;
cout << setw(25) << s1.roll_Number << setw(20) << r1.pf_Score << '\n' << '\n' ;
cout << setw(25) << s2.roll_Number << setw(20) << r2.pf_Score << '\n' << '\n' ;
cout << setw(25) << s3.roll_Number << setw(20) << r3.pf_Score << '\n' << '\n' ;
goto MAIN;

}else if( i == 3)
{
exit(0);
}
}while(i < 4);

getch();
return 0;
}

You might also like