Question 21.Program to find total marks of five subjects, average, percentage, gpa and obtaining grade.

February 21, 2019
Question 21. Program to find total marks of five subjects, average, percentage, gpa and obtaining grade.
1 // GPA.cpp : Programme to find total marks of five subjects, average, percentage, gpa and obtaining
grade.
2 //
34
#include "stdafx.h"
5 #include "iostream"
6 using namespace std;
7 int main()
8 {
9 double Isl = 0, Cal = 0, Itc = 0, Ipf = 0, Phy = 0, T_Marks = 0; int Avg = 0,Per = 0, Gp = 0; //
Declaration of variables
10 cout << "<Enter the subjects Marks>\n"; // Inputing the marks of Subjects.
11 cout << "Enter Islamiat Marks :";
12 cin >> Isl;
13 cout << "Enter Calculus-I Marks :";
14 cin >> Cal;
15 cout << "Enter Introduction To Computing Marks :";
16 cin >> Itc;
17 cout << "Enter Introduction To Programming Funndaments Marks:";
18 cin >> Ipf;
19 cout << "Enter Physics Marks :";
20 cin >> Phy;
21 T_Marks = Isl+Cal+Ipf+Itc+Phy; // Calculations for the total marks
22 cout << "Total Marks Of Five Subjects are="<<T_Marks<<endl;
23 Avg = (T_Marks)/5; // Calculations for the Average marks
24 cout << "The Average of Five Subjects is ="<<Avg<<endl;
25 Per = (T_Marks*100)/500; // Calculations for the Percentage marks
26 cout << "The Percentage of Five Subjects is ="<<Per<<endl;
27 if(Isl==0 && Isl<50) // Finding grade point for Islamic Studies subject.
28 {
29 Isl = 0.00;
30 }
31 else if(Isl<55 &&Isl>=50)
32 {
33 Isl = 1.00;
34 }
35 else if(Isl<58 && Isl>=55)
36 {
37 Isl = 1.70;
38 }
39 else if(Isl<61 && Isl>=58)
40 {
41 Isl =2.00;
42 }
43 else if(Isl<65 && Isl>=61)
44 {
45 Isl = 2.30;
46 }
47 else if(Isl<70 && Isl>=65)
48 {
49 Isl = 2.70;
50 }
51 else if(Isl<75 && Isl>=70)
52 {
53 Isl = 3.00;
54 }
55 else if(Isl<80 && Isl>=75)
56 {
57 Isl = 3.30;
58 }
59 else if(Isl<85 && Isl>=80)
60 {
61 Isl = 3.70;
62 }
63 else if(Isl>=85)
64 {
65 Isl = 4.00;
66 }
67 if(Cal==0 && Cal<50) // Finding grade point for Calculus subject.
68 {
69 Cal = 0.00;
70 }
71 else if(Cal<55 &&Cal>=50)
72 {
73 Cal = 1.00;
74 }
75 else if(Cal<58 && Cal>=55)
76 {
77 Cal= 1.70;
78 }
79 else if(Cal<61 && Cal>=58)
80 {
81 Cal =2.00;
82 }
83 else if(Cal<65 && Cal>=61)
84 {
85 Cal = 2.30;
86 }
87 else if(Cal<70 && Cal>=65)
88 {
89 Cal = 2.70;
90 }
91 else if(Cal<75 && Cal>=70)
92 {
93 Cal = 3.00;
94 }
95 else if(Cal<80 && Cal>=75)
96 {
97 Cal = 3.30;
98 }
99 else if(Cal<85 && Cal>=80)
100 {
101 Cal = 3.70;
102 }
103 else if(Cal>=85)
104 {
105 Cal = 4.00;
106 }
107 if(Itc<50) // Finding grade point for Introduction to Computing subject.
108 {
109 Itc = 0.00;
110 }
111 else if(Itc<55 &&Itc>=50)
112 {
113 Itc = 1.00;
114 }
115 else if(Itc<58 && Itc>=55)
116 {
117 Itc= 1.70;
118 }
119 else if(Itc<61 && Itc>=58)
120 {
121 Itc =2.00;
122 }
123 else if(Itc<65 && Itc>=61)
124 {
125 Itc = 2.30;
126 }
127 else if(Itc<70 && Itc>=65)
128 {
129 Itc = 2.70;
130 }
131 else if(Itc<75 && Itc>=70)
132 {
133 Itc = 3.00;
134 }
135 else if(Itc<80 && Itc>=75)
136 {
137 Itc = 3.30;
138 }
139 else if(Itc<85 && Itc>=80)
140 {
141 Itc = 3.70;
142 }
143 else if(Itc>=85)
144 {
145 Itc = 4.00;
146 }
147 if(Ipf==0 && Ipf<50) // Finding grade point for Introduction to programming
fundamentals subject.
148 {
149 Ipf = 0.00;
150 }
151 else if(Ipf<55 &&Ipf>=50)
152 {
153 Ipf = 1.00;
154 }
155 else if(Ipf<58 && Ipf>=55)
156 {
157 Ipf= 1.70;
158 }
159 else if(Ipf<61 && Ipf>=58)
160 {
161 Ipf =2.00;
162 }
163 else if(Ipf<65 && Ipf>=61)
164 {
165 Ipf = 2.30;
166 }
167 else if(Ipf<70 && Ipf>=65)
168 {
169 Ipf = 2.70;
170 }
171 else if(Ipf<75 && Ipf>=70)
172 {
173 Ipf = 3.00;
174 }
175 else if(Ipf<80 && Ipf>=75)
176 {
177 Ipf = 3.30;
178 }
179 else if(Ipf<85 && Ipf>=80)
180 {
181 Ipf = 3.70;
182 }
183 else if(Ipf>=85)
184 {
185 Ipf = 4.00;
186 }
187 if(Phy == 0 && Phy<50) // Finding grade point for Physics subject.
188 {
189 Phy = 0.00;
190 }
191 else if(Phy<55 &&Phy>=50)
192 {
193 Phy = 1.00;
194 }
195 else if(Phy<58 && Phy>=55)
196 {
197 Phy= 1.70;
198 }
199 else if(Phy<61 && Phy>=58)
200 {
201 Phy =2.00;
202 }
203 else if(Phy<65 && Phy>=61)
204 {
205 Phy = 2.30;
206 }
207 else if(Phy<70 && Phy>=65)
208 {
209 Phy = 2.70;
210 }
211 else if(Phy<75 && Phy>=70)
212 {
213 Phy = 3.00;
214 }
215 else if(Phy<80 && Phy>=75)
216 {
217 Phy = 3.30;
218 }
219 else if(Phy<85 && Phy>=80)
220 {
221 Phy = 3.70;
222 }
223 else if(Phy>=85)
224 {
225 Phy = 4.00;
226 }
227 Gp = (Isl*3 + Cal*3 + Itc*3 + Ipf*4+Phy*4)/17; //Calculations for finding grade point.
228 cout << "Grade point is ="<<Gp<<"\n";
229 if(Per==0 && Per<50) //Conditions for finding obtain grade.
230 {
231 cout << "Obtain Grade is: F";
232 }
233 if(Per>=50 && Per<55)
234 {
235 cout << "Obtain Grade is: D";
236 }
237 if(Per>=55 && Per<58 )
238 {
239 cout << "Obtain Grade is: C-";
240 }
241 if (Per>=58 && Per<61)
242 {
243 cout << "Obtain Grade is: C";
244 }
245 if(Per>=61 && Per<65)
246 {
247 cout << "Obtain Grade is: C+";
248 }
249 if(Per>=65 && Per<70)
250 {
251 cout << "Obtain Grade is: B-";
252 }
253 if(Per>=70 && Per<75)
254 {
255 cout << "Obtain Grade is: B";
256 }
257 if(Per>=75 && Per<80)
258 {
259 cout << "Obtain Grade is: B+";
260 }
261 if(Per>=80 && Per<85)
262 {
263 cout << "Obtain Grade is: A-";
264 }
265 if(Per>=85)
266 {
267 cout << "Obtain Grade is:A";
268 }
269 return 0;
270 }

No comments:

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();
Powered by Blogger.