Question: Can you explain more details on what is the code about . Need the answers as soon as possible . Thank you . SUN 000)
Can you explain more details on what is the code about . Need the answers as soon as possible . Thank you .
SUN 000) 12 1 #include 2 using namespace std; 3 4 struct student //structure 5 { 6 char name [50]; 7 int matrics; 8 9 //declare function 10 void getdata(); void showdata(); void calculate(int eng_marks, int math_marks, int sci_marks, int lang2_marks, int cs_mark); 13 char showgrade (double average); 14 void swap(int *ne, int *eng_marks); 15 void swap2(int *nm, int *math_marks); 16 void swap3(int *ns, int "sci_marks); void swap4(int *nL, int *lang2 marks); 18 void swaps(int *nc, int *cs_marks); 19 20 int main() 21 { 22 double average; 23 student s; getdata(); 25 showdata(); 26 return 0; 27 } 28 29 void getdata() //user input function 30 { 31 student sy 32 int eng_marks, math_marks, sci_marks, lang2_marks, cs_marks; 24 No u pw N 32 int eng_marks, math_marks, sci_marks, lang2_marks, cs_marks; 33 cout>s.matrics; 35 cout>s.name; 37 cout>eng_marks; 40 cout>math_marks; 42 cout>sci marks; 44 cout>lang2_marks; 46 cout>cs_marks; 48 } 49 50 void showdata() // view data function 51 { 52 student s; 53 int eng_marks, math_marks, sci_marks, lang2_marks, cs_marks; 54 cout>change; 72 do // do while loop to update data 73 2 { 74 int subject,ne,nM, ns, nl,nC; 75 cout>subject; switch(subject) //switch to insert new marks 78 D 79 case 1: 80 cout >nE; 82 swap(&nE,&eng_marks); 83 cout>nM; 88 swap2 (&nM,&math_marks); 89 cout>ns; BB88 28 2 case 3: OOOOO NM LO 96 92 cout >ns; 94 swaps (ens,&sci_marks); 95 cout>nl 100 swap4 (ent,&lang2 marks); 101 cout>nc5 106 swaps (&nc,&cs marks); 107 cout=90) 119 0 { 120 grade= 'A': 121 } 122 else if(average>=75) 123 { 122 else if(average >=75) 123 D { 124 grade='B'; 125 } 126 else if(average>=50) 127 0 { 128 grade='c's 129 } 130 else 131 D { 132 grade='F's 133 134 return grade; 135 136 void swap(int *nE, int *eng_marks) // void swap function 137 ? { 138 int temp = *nE; //pointer for swap old marks to new marks 139 nE = eng_marks; 140 *eng_marks temps 141 } 142 void swap2 (int *nM, int *math_marks) void swap function 143 p { 144 nM3 //pointer for swap old marks to new marks 145 *math_marks; 146 * math marks temp; 147 } 148 void swap3(int *ns, int *sci_marks) void swap function 149 p { 150 int temp = *ns; //pointer for swap old marks to new marks 151 *ns *sci_marks; 152 *sci_marks temps 153 } int temp nM - 153 L } 154 void swap4(int *nL, int *lang2_marks) V/void swap function 155 { 156 int temp = *nL; //pointer for swap old marks to new marks 157 *nL = *lang2_marks; 158 *lang2_marks = temp; 159 } 160 void swap5(int *nc, int *cs_marks) // void swap function 161 Q { 162 int temp *nC; //pointer for swap value old marks to new marks 163 *nC = *cs_marks; 164 *cs marks = temp; 165 } 166 333.2an hasta el procedimenger ates student's matrics number: 2115347 Entes student name: cam 11 marks should be out of 100 Fater marks in English: Enter marks in Math: Inler marks in Science: Enter marks in 2nd language: Enter marks in Computer science: atrics number of student : 2115347 Name of student : adas Lnglish : 70 Laths : 90 xience : 60 Language2 : 50 Computer Science :80 biverage : the grade is: C you want to change mark? (Y=yes/li=no): subject?(1-english, 2-sath,3-science, 1-2nd language, 5-computer science): 2 nearks: 75 pdated Mulhs murks : 75 Process Exiled with relurn value Press any key to continue