You are on page 1of 3

1 #include <iostream>

2 #include <cstring>
3 #include <iomanip>
4
5 using namespace std;
6
7 int main() {
8
9 float quiz1, quiz2, quiz3, quiz4, quiz5, tQuiz;
10 float test1, test2, tTest, lab1, lab2, tLab;
11 float mProject, tProject, carrymarks;
12 char option;
13
14
15 here:
16 cout << fixed << setprecision(2);
17 cout <<"\n\nPlease enter your quiz 1 marks: ";
18 cin >>quiz1;
19
20 if (quiz1 > 15){
21 cout << "\nPlease enter the correct marks for quiz 1: ";
22 cin >>quiz1;
23 }
24 cout <<"\nPlease enter your quiz 2 marks: ";
25 cin >>quiz2;
26
27 if (quiz2 > 15){
28 cout << "\nPlease enter the correct marks for quiz 2: ";
29 cin >>quiz2;
30 }
31
32 cout <<"\nPlease enter your quiz 3 marks: ";
33 cin >>quiz3;
34
35
36 if (quiz3 > 15){
37 cout << "\nPlease enter the correct marks for quiz 3: ";
38 cin >>quiz3;
39 }
40
41 cout <<"\nPlease enter your quiz 4 marks: ";
42 cin >>quiz4;
43
44 if (quiz4 > 15){
45 cout << "\nPlease enter the correct marks for quiz 4: ";
46 cin >>quiz4;
47 }
48
49 cout <<"\nPlease enter your quiz 5 marks: ";
50 cin >>quiz5;
51
52 if (quiz5 > 15){
53 cout << "\nPlease enter the correct marks for quiz 5: ";
54 cin >>quiz5;
55 }
56
57 tQuiz = (((quiz1/15)*3)+((quiz2/15)*3)+((quiz3/15)*3)+((quiz4/15)*3)+((quiz5/15)*3));
58 cout <<"\nTotal marks for all quizzes are: "<<tQuiz;
59
60 cout <<"\n\nPlease enter your test 1 marks: ";
61 cin >>test1;
62
63 if (test1 > 50){
60 cout <<"\n\nPlease enter your test 1 marks: ";
61 cin >>test1;
62
63 if (test1 > 50){
64 cout << "\nPlease enter the correct marks for test 1: ";
65 cin >>test1;
66 }
67
68 cout <<"\nPlease enter your test 2 marks: ";
69 cin >>test2;
70
71 if (test2 > 50){
72 cout << "\nPlease enter the correct marks for test 2: ";
73 cin >>test2;
74 }
75
76 tTest = (((test1/50)*10)+((test2/50)*10));
77 cout <<"\nTotal marks for all tests are: "<<tTest;
78
79 cout <<"\n\nPlease enter your lab assignment 1 marks: ";
80 cin >>lab1;
81
82 if (lab1 > 30){
83 cout << "\nPlease enter the correct marks for lab assignment 1: ";
84 cin >>lab1;
85 }
86
87 cout <<"\nPlease enter your lab assignment 2 marks: ";
88 cin >>lab2;
89
90 if (lab2 > 30){
91 cout << "\nPlease enter the correct marks for lab assignment 2: ";
92 cin >>lab2;
93 }
94
95 tLab = (((lab1/30)*2.5)+((lab2/30)*2.5));
96 cout <<"\nTotal marks for all lab assignments are: "<<tLab;
97
98 cout <<"\n\nPlease enter your mini project marks: ";
99 cin >>mProject;
100
101 if (mProject > 100){
102 cout << "\nPlease enter the correct marks for mini project: ";
103 cin >>mProject;
104 }
105
106 tProject = ((mProject/100)*10);
107 cout <<"\n\nTotal marks for mini project are: "<<tProject;
108
109 carrymarks = tQuiz + tTest + tLab + tProject;
110 cout <<"\n\nTotal your carrymarks are: "<<carrymarks<<"/50\n\n";
111
112 if(carrymarks > 39 && carrymarks <= 50)
113 cout <<"You need to get at least 20% for your final exam to get C or pass.\n\n";
114 else if(carrymarks > 29 && carrymarks < 40)
115 cout <<"You need to get at least 40% for your final exam to get C or pass.\n\n";
116 else if(carrymarks > 19 && carrymarks < 30)
117 cout <<"You need to get at least 60% for your final exam to get C or pass.\n\n";
118 else if(carrymarks > 10 && carrymarks < 20)
119 cout <<"You need to get at least 80% for your final exam to get C or pass.\n\n";
120 else
121 cout <<"You need to get at least 100% for your final exam to get C or pass.\n\n";
122
123 cout <<"You want to do it again? Y for yes OR N for no ";
120 else
121 cout <<"You need to get at least 100% for your final exam to get C or pass.\n\n";
122
123 cout <<"You want to do it again? Y for yes OR N for no ";
124 cin >>option;
125
126 if(option == 'Y' || option == 'y')
127 goto here;
128
129 else{
130 cout <<"TQ & Good Luck for Final Exam!\n\n";
131 exit(0);
132 }
133
134 return 0;
135 }

You might also like