-->Introduction to Programming
-->
Problem Statement: Assessment system
You are required to
write a program for Assessment system of
a University. The basic idea is to
calculate the GPA (Grade Point Average) of each subject and then calculate the
GPA of whole semester and on the basis of that GPA calculate the grade and
remarks.
Detailed Description:
You are required to
take the student’s marks for three subjects(English, Calculus, and Computer) as
input from the user. After that calculate the GPA of each subject and the whole
semester. Assume that total marks of a subject are 100 and each subject is of 3
credit hours.
Complete Assessment system
is given below:
Grade
|
GPA
|
Marks Obtained
|
Remarks
|
A
|
4.00
|
100 %
|
Excellent
|
B
|
3.00-3.99
|
75-99 %
|
Good
|
C
|
2.00-2.99
|
50-75 %
|
Satisfactory
|
D
|
1.6-1.99
|
40-49 %
|
Pass
|
F
|
0.00
|
Below 40 %
|
Fail
|
- GPA for a subject = (obtained marks / 100) * 4 where 100 is the total marks of a subject.
NOTE: If
user enters less than 40 marks for a subject, the GPA of that subject should be
0.
- GPA of whole semester = multiply each grade point you receive by the number of credit hours for that course, add up the totals, and then divide by the total number of credit hours taken in that semester.
For example suppose the GPA in subject A is 2.5, in subject B
2.6, and in subject C is 3. Assuming
that each subject is of 3 credit hours then GPA of whole semester will be
calculated as:
= 3
* ( 2.5 + 2.6 + 3 ) / 9
=
2.7
- On the
basis of Semester GPA, you have to give grade and remarks to the student
- If a student has less than 40 marks in a subject, a message should display that “you have to repeat this subject “.
- After displaying the GPA, grade and remarks, the program should ask the user if he/she wants to perform this task again. The user will be given two options (yes / no). If user enters “Y or y”, the program will start calculating the GPA, grade and remarks again. If user selects “N or n”, the program will terminate.
Solution of CS201: Assignment No 1 Semester: Fall 2012
#include<iostream.h>#include<conio.h>
#include<string.h>
using namespace std;
main()
{
float eng,calc,cmp,eng_gpa,cmp_gpa,calc_gpa,t_gpa;
char grade,option;
string remarks="";
start:
system("cls");
cout<<"****************************** Assessment System ******************************\n\n\n\n";
//Calculation of english gpa
cout<<"Enter marks of English : ";
cin>>eng;
if(eng<40){
eng_gpa=0;
cout<<"\nYou have to repeat this subject\n";
}
else
eng_gpa=(eng/100)*4;
cout<<"\nGPA of english =\t"<<eng_gpa;
//Calculation of computer gpa
cout<<"\n\n\nEnter marks of Computer : ";
cin>>cmp;
if(cmp<40){
cmp_gpa=0;
cout<<"\nYou have to repeat this subject\n";
}
else
cmp_gpa=(cmp/100)*4;
cout<<"\nGPA of Computer =\t"<<cmp_gpa;
//Calculation of calculac gpa
cout<<"\n\n\nEnter marks ofCalculac : ";
cin>>calc;
if(calc<40){
calc_gpa=0;
cout<<"\nYou have to repeat this subject\n";
}
else
calc_gpa=(calc/100)*4;
cout<<"\nGPA of Calculac =\t"<<calc_gpa;
//whole smester gpa
t_gpa=3*(eng_gpa+cmp_gpa+calc_gpa)/9;
cout<<"\n\n\nGPA of whole smester = \t"<<t_gpa;
//Grade and remarks calculation
if(t_gpa==4)
{
grade='A';
remarks="Excellent";
}
else if(t_gpa>=3.00 and t_gpa<=3.99)
{
grade='B';
remarks="Good";
}
else if(t_gpa>=2.00 and t_gpa<=2.99)
{
grade='C';
remarks="Satisfactory";
}
else if(t_gpa>=1.6 and t_gpa<=1.99)
{
grade='D';
remarks="Pass";
}
else
{
grade='F';
remarks="Fail";
}
cout<<"\nGrade = "<<grade;
cout<<"\nRemarks = "<<remarks;
cout<<"\n\nDo you want to perform this task again (Y/N)";
cin>>option;
switch(option)
{
case 'Y':
case 'y':goto start;
case 'N':
case 'n': exit(0);
}
system("pause");
}
No comments:
Post a Comment