1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
#include <string>
#include <iostream>
#include <cstdlib>
using namespace std;
class NatDipstudent : public HNDstudent
{
public:
NatDipstudent(string isurname, char iinitial, double iID, int ilevel,
string iqual_title, int iyear, string igrade)
{
surname=isurname;
initial=iinitial;
ID=iID;
level=ilevel;
qual_title=iqual_title;
year=iyear;
final_grade=igrade;
}
~NatDipstudent(){}
void Set_surname(string sur)
{
cout<<"what is the student's surname?";
cin>>sur;
surname=sur;
}
void Set_initial(char init)
{
cout<<"what is the student's initial?";
cin>>init;
initial=init;
}
void Set_ID(double an_ID)
{
cout<<"what is the student's ID?";
cin>>an_ID;
ID=an_ID;
}
void Set_level (int a_level)
{
cout<<"what is the qualification level?";
cin>>a_level;
level=a_level;
}
void Set_qual_title (string qual)
{
cout<<"what is the qualification title- ?";
cin>>qual;
qual_title=qual;
}
void Set_year (int a_year)
{cout<<"what year will the student achieve?";
cin>>a_year;
year=a_year;
}
void Set_grade(string a_grade)
{
int total=0;
string grade;
int units[18]={1,2,3,5,6,7,10,12,13,17,1,19,20,24,25,26,42,43};
int points[18];
string title[18]={"C&E", "Computer Systems","IS",
"ADbs", "ASs", "SAD","Client Side","Games", "HCI", "Maths", "pSDD", "Web Server Scripting",
"ED", "Graphics", "OO", "Animation", "CCAN1", "CCNA2" };
int i;
for(i=0; i<18; i=i+1)
{
cout<<"Enter grade for unit "<< units[i] <<" " << title[i]<<" ";
cin>>points[i];
}
for(i=0; i<18; i=i+1)
{
total=points[i]+total;
}
cout<<endl;
if(total>251)
{grade="DDD";}
else if (total>227)
{grade="DDM";}
else if (total>203)
{grade="DMM";}
else if (total>179)
{grade="MMM";}
else if (total>155)
{grade="PMM";}
else if (total>131)
{grade="PPM";}
else if (total>107)
{grade="PPP";}
else if (total<108)
{grade="fail";}
cout<<"Total points accrued is "<<total<<endl;
cout<<"Your grade is "<<grade<<endl;
a_grade=grade;
final_grade=a_grade;
}
string Get_surname(){return surname;}
char Get_initial(){return initial;}
double Get_ID(){return ID;}
string Get_qual_title(){return qual_title;}
int Get_level() {return level;}
int Get_year(){return year;}
string Get_grade(){return final_grade;}
private:
string surname;
char initial;
double ID;
int level;
string qual_title;
int year;
string final_grade;
};
|