You are on page 1of 8

Jhon Patrick E.

Ramos EDP101L (6963)

Let’s Check

Task-A

Flow chart:

Source code:

#include<iostream>

#include<iomanip>

#include <conio.h>

#include<string>

using namespace std;

int main(){

double exam1, exam2, exam3, exam4, score, exer1, exer2, exer3, exer4, proj, quiz1, quiz2,
quiz3, generalaverage,a, b,c,d,e,f,g,h,i,j,a1,a2,b1;

char point;

int ascii_value,l = 1;

while (l ==1)

cout<< setw(50)<<"Computation of Grades"<< endl;

cout<<"Major Examinations (100 pts each)\n";


cout<< setw(15)<<"First: "; cin>>exam1;

if (exam1<=100 && exam1>=0)

cout<<setw(15)<<"First Exam Score: "<<exam1<< endl;

else

cout<< "You enter more than 100 or less than 0\n";

cout<<"Enter the exact value: "; cin>>exam1;

cout<< setw(15)<<"Second: "; cin>>exam2;

if (exam2<=100 && exam2>=0)

cout<<setw(15)<<"Second Exam Score: "<<exam2<<endl;

else

cout<<"You enter more than 100 or less than 0\n";

cout<<"Enter the exact value: "; cin>>exam2;

cout<< setw(15)<<"Third: "; cin>>exam3;

if (exam3<=100 && exam3 >=0)

cout<< setw(15)<<"Third Exam Score: "<<exam3<<endl;

else

cout<<"You enter more than 100 or less than 0\n";

cout<<"Enter the exact value: ";cin>>exam3;

}
cout<< setw(15)<<"Final: "; cin>>exam4;

if (exam4<=100 && exam4>=0)

cout<<setw(15)<<"Final Exam Score: "<<exam4<<endl;

else

cout<<"You enter more than 100 or less than 0\n";

cout<<"Enter the exact value: ";cin>>exam4;

cout<<"Laboratory Exercises (50 pts each)\n";

cout <<setw(15)<<"Exer#1: "; cin>>exer1;

if (exer1<=50 && exer1>=0)

cout<< setw(15)<<"Exercise 1: "<<exer1<<endl;

else

cout<<"You enter more than 50 or less than 0\n";

cout<<"Enter the exact value: ";cin>>exer1;

cout<<setw(15)<<"Exer#2: "; cin>>exer2;

if (exer2<=50 && exer2>=0)

cout<<setw(15)<<"Exercise 2: "<<exer2<<endl;

else

cout<<"You enter more than 50 or less than 0\n";


cout<<"Enter the exact value: ";cin>>exer2;

cout<<setw(15)<<"Exer#3: "; cin>>exer3;

if (exer3<=50 &&exer3>=0)

cout<<setw(15)<<"Exercise 3: "<<exer3<<endl;

else

cout<<"You enter more than 50 or less than 0\n";

cout<<"Enter the exact value: ";cin>>exer3;

cout<<setw(15)<<"Exer#4: "; cin>>exer4;

if (exer4<=50 && exer4>=0)

cout<<setw(15)<<"Exercise 4: "<<exer4<<endl;

else

cout<<"You enter more than 50 or less than 0\n";

cout<<"Enter the exact value: ";cin>>exer4;

cout<<"Laboratory Project (100 pts): "; cin>>proj;

if (proj<=100 && proj>=0)

cout<<setw(15)<<"Project: "<<proj<<endl;

else

cout<<"You enter more than 100 or less than 0\n";


cout<<"Enter the exact value: ";cin>>proj;

cout<<"Quizzes (40 pts each)"<<endl;

cout<<setw(15)<<"Qz#1: "; cin>>quiz1;

if (quiz1<=40 && quiz1>=0)

cout<<setw(15)<<"Quiz 1: "<<quiz1<<endl;

else

cout<<"You enter more than 40 or less than 0\n";

cout<<"Enter the exact value: ";cin>>quiz1;

cout<<setw(15)<<"Qz#2: "; cin>>quiz2;

if (quiz2<=40 && quiz2>=0)

cout<<setw(15)<<"Quiz 2: "<<quiz2<<endl;

else

cout<<"You enter more than 40 or less than 0\n";

cout<<"Enter the exact value: ";cin>>quiz2;

cout<<setw(15)<<"Qz#3: "; cin>>quiz3;

if (quiz3<=40 && quiz3>=0)

cout<<setw(15)<<"Quiz 3: "<<quiz3<<endl;

else

{
cout<<"You enter more than 40 or less than 0\n";

cout<<"Enter the exact value: ";cin>>quiz3;

cout<<endl;

cout<<endl;

a = exam1+exam2+exam3;

a1= (a/300)*285+15;

a2= (a1*.3);

b = (exam4/100)*85+15;

b1= (b*.3);

c = (a2+b1);

cout<<"General Score of Examination: "<<setprecision(3)<<c<<endl;

d = exer1+exer2+exer3+exer4;

e = (d/200)*385+15;

f = (e*.1);

cout<<"General Score of Lab. Exercise: "<<setprecision(3)<<f<<endl;

g = (proj/100)*(85+15)/2 ;

cout<<"Score of Lab. Projects: "<<setprecision(3)<<g<<endl;

h = quiz1+quiz2+quiz3;

i = (h/120)*285+15;

j = (i*.1);

cout<<"General Score of Quizzes: "<<setprecision(3)<<j<<endl;


cout<<endl;

cout<<endl;

score = c+f+g+j;

generalaverage =(score/210)*85+15;

cout<<"Gen. Av. : "<<generalaverage<<endl;

if (generalaverage>= 95 && generalaverage<= 100)

cout<<"Remark: Excellent"<<endl;

else if(generalaverage<=94 && generalaverage>=90)

cout<<"Remark: Very Good"<<endl;

else if(generalaverage>=89 && generalaverage<=85)

cout<<"Remark: Good"<<endl;

else if (generalaverage >=80 && generalaverage<=84)

cout<<"Satisfactory"<<endl;

else if(generalaverage<=79 && generalaverage>=75)

cout<<"Remark: Fair"<<endl;

else

cout<<"Remark: Failed"<<endl;

cout<<"Press Enter to Re-run the Program\n";

cout<<"Press any key to Exit";

l=0;
point = getch();

ascii_value = point;

if (ascii_value == 13)

l=1;

else

break;

system("cls");

return 0;

You might also like