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

CPP - Assignment 8

Uploaded by

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

CPP - Assignment 8

Uploaded by

heet81276
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

tart here X assign cpp X

1 #1nclude <iost team

3
$1ncludestI1ng
usi ng namespace std:
4 struct StudentRec
5
string name
7 int Rollno:
float attende ceperC:
char Grade:
10

13 1nt a1n

15 stract StudentRec sl:


struct StudentRec s2:
17 struct StudentRec s3:
struct StudentRec s4:
19 sl.name="sIavan":
sl.Rollno=-:
sl.attendeceperc=e:
sl.Grade:
23
24 s2.name="Pavan":
25 s2.Rollno2:
2¬ s2.attendecepercél:
27 s2.Grade:
29
29 s3.ame="ravan":
30 93.Rol lno=3:
31
s3.attendecepercé0:
32 s3.Grade:
33
34 94.nameABHI":
35 94.Rollno-4:

s4.attendeceperc-100:
37 s$.Grade:
32 cout Deta1ls of first student"<endl:
39 COut9l.namecendl:
40 couts1.Rollnor<endl:
41 COut9l.atLendeceperCend1 :
42 cout«sl.Gradecendl:
43
44 cout<"Details of second student"< endl:
45 cout92.naeend1:
cout<<92.Rollnoendl :
47 cout<< s2.attendecepercccend!:
48 cout<<92.Gradeendl:
20
sl.Rollno 1:
21
22
s1.attende ceperce:
sl.Grade:
23
24
92.name-"Pavan":
25 s2.Rollno-2:
26
27
92.attendeceperc0:
s2.Gr a d e :

29
s3.name"Kravan" :
30 s3.Rollno 3:
31
32
93.attendeceperce0:
s3.Grade':
33
34 s4.name "ABHI":
35 s4.Rollno4:

s4.attendeceperc 100:
37 s4.Grade-:
38 cout<"Details cof first student"<<endl:
39 cout<<sl.name<<endl:
40
Cout<sl.Rollno<<endl:
41
42
cout<<9l.attendeceperc<<endl:
cout<<sl.Grade<<endl:
43
44 cout<<"Details of second student "<<endl:
45 COut<<s2.name<<endl:
CODt<s2.Rollno<<endl:
47
cout<<s2.attendeceperc<cendl:
Cout 92.Grade<<endl:
49
50 coat<<" Details of third student"<<endl;
CODt s3.name<endl:
52 Cout<<s3.Rollno<<endl:
53 cout<93.attendecepercc<endl:
54 Cout<93.Gradecendl:

cOutDetails of forth student"<<endl:


Cout<94.name<endl:
COut94.Rollno<endl:
couts4.attendeceperc<<endl:
60 cOut<s4.Gradeendl:

¬2

return :
Hes

Details of first student


sravan
1
60
A
Details of second student
Pavan
2
60
A
Details of third student
Kravan
3
60
A
Details of forth student
ABHI
4
A

execution ti me: 0.078 s


Process returned e (exe)
Press any key to continue..
activate Settings
to to Go EnrolNloc<endl; <«Í«student[1]. COut<eenrollment
no 32
Windows Activate i-;iM;i+){ for(int 31
30
N)
int student
[], (StudentRec print void 29
28
27
26
cout<«student[3]
.CGPAK<" 25
j-e;jaN;
j+) for(int 24
23
22
21
20
19
18
tep; []
-student L7
student[1]: student[1]
- 16
15
[1);student StudentRec
temp 14
.cPA).cGPAKstudent
[1] if(student[3] 13
-i+1;jN;j+){ for(intJ 12
1-9;1M-1;1+){ (int for 11
student[0,
N){ int (StudentRec sort void 10
branch; string
CGPA; float
6
EnrolNo; int
Rec{Student struct
std;
namespace using
#includecstring>
include<iostream>
a.cpp &
Gacpp >main
29 void print (StudentRec student [], int N){
33 cOut<<"CGPA OF " <«i«student [1] .cGPA<Kendl;
34
cout<<"Branch of <<i««student[].branch<<endl;
35 }
3 return;
37
38 int sain()
39 int N-3;
40 StudentRec student [N];
41 student [e].EnrolNo 1;
47 student[e] .CGPA - 10;
43 student[O].branch - "cSE";
44
45 student [1]. EnrolNo2;
46
student [1].cGPA 9.9;
47
student[1].branch - "AIDS";
48
49 student[2] .EnrolNo- 3;
50 student [2].cGPA - 9.8;
51 student [2].branch - "ECE";
$2
53 cout<<"data unsorted";
54 print (student, N);
55 cout<<"data sort";
56
sort(student, N);
57
58 return e;
59
PROBLEMS OUTPUT DEBUG CONSOLE TERMNNAL. PORTS Code t 0
PS C:\Wsers\ShreeDesktop\CoDE HARRY cd "c:Users\ShreeDesktop\CoDE HAen ; if ($?) { Gt a.cpp -o a}; if ($) { )
data unsortedenollent no 01
CGPA OF 09.88
Branch of eCSE
enrolinent no 12
CGPA OF 19.9
Branch of 1AIDS
enrollent no23
CGPA OF 29.8
Branch of 2£CE
data sort9.88 9.9 9.9
PS C: Users\Shree \Desktop\C0DE HARRY>
G.pp
G assign62.cpp G ap4.qpP
32.exe
Fap131.exe
G bpp -
includeciostreaD
1
using namespace std;
2
struct Tine{
int hours;
int inutes;
5
int seconds:

void setTie(Tie &t){


cout<«"ENTER THE hour":
cin>>t.hours;
1 cout<<"Enter the dnutes:
11
12
cin)>t.minutes;
COut<<"enter the seconds":
13
cin>>t.seconds;
14
15 return
16
17 displayTime (Time &t){
void cout<ct.hours<<":;
18
cout<ct.dnutes<¢:;
19

cout<ct.seconds<«*:";
21 return;
22
23
24 int main(0{
25 Tie t ;
26 setTine(t);
27 displayTne (t) ;
28 rturn 8;
29
Hle Edt Seiection View Go Run ** P cODE HARRY

EXPLORER PROBLEMS OUTPUT DEBUG CONSOLE TERMINA PORTS

> OPEN EDITORS


Ov oDE HARRY PS C:Wsers\shreDesktop\CDE
hour
HARRY d c:Uers\hrelDesktop\CIDE ARRYN ; if ($) ( B b.cpp -o b): if (s
inutes6
E ap1613.exe enter the serondss
& ap1614<pp 4:6:56:
E apl614exe PS C:Users\Shree\Desktop\CODE HARRY>
G assign3.pp
Fassign3.exe
G assign62.4pp
Fassign62.exe
G assingn4cpp
assingn4.exe
Cbpp
b.exe
G faccpP

Facexe

You might also like