:!: The Question is like this...
About: Subject registration system.
The lecture want
1. Name, Matric Number, Cumulative Grade Percentage Average (CGPA)
CGPA........A=4.0,A-=3.7,B+=3.3,B=3.0,B-=3.7,C+=3.33,C=2.0, F=0.
Name, Matric No,CGPA key in by user. So no need to worried.
2.Condition for CGPA
if CGPA<2.0, can apply up to 18credit hours
if CGPA>2.0, can apply more then 18 credit hours
3.with this condition
the user will select the courses they wan to apply
4. After selected, The program will print out all the selected course that their are entered. [this part i Quite headache]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
THis is my source code:
(i got problem at the last part-print out the staff. Any idea to solve it. Thank ;) )
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#include <iostream.h>
#include <cstring>

class subject{
private:
char *name;
char *matric;
int cgpa;
char sub[14][100];
public:
subject(char * =" ",char * =" ",int=0);
~subject(){}
void setData(char * =" ",char * =" ",int=0);
void select();
void print();
};

subject::subject(char *temp1,char *temp2,int c)
{
name=new char [];
strcpy(name,temp1);
matric=new char[];
strcpy(matric,temp2);
cgpa=c;
sub[14][100]={
"GXEX1401 Kursus Kemahiran Maklumat", "1",
"GXEX1403 Titas Kertas 2","2",
"WRES1103 Rekabentuk Digital","3",
"WRES1201 Senibina Sistem Komputer", "3",
"WRES2101 Internet & Intranet", "3",
"WXES1111 Prinsip Pengaturcaraan Berorientasikan Objek","3",
"WXES1112 Matematik Pengkomputeran 1","3"}
}

void subject::setData(char *temp1,char *temp2,int c)
{
name=new char [];
strcpy(name,temp1);
matric=new char[];
strcpy(matric,temp2);
cgpa=c;
sub[14][100]={
"GXEX1401 Kursus Kemahiran Maklumat", "1",
"GXEX1403 Titas Kertas 2","2",
"WRES1103 Rekabentuk Digital","3",
"WRES1201 Senibina Sistem Komputer", "3",
"WRES2101 Internet & Intranet", "3",
"WXES1111 Prinsip Pengaturcaraan Berorientasikan Objek","3",
"WXES1112 Matematik Pengkomputeran 1","3"}
}

void subject::select()
{
cout<<"1.GXEX1401 Kursus Kemahiran Maklumat\t1\n"
<<"2.GXEX1403 Titas Kertas 2\t2\n"
<<"3.WRES1103 Rekabentuk Digital\t3\n"
<<"4.WRES1201 Senibina Sistem Komputer\t3\n"
<<"5.WRES2101 Internet & Intranet\t3\n"
<<"6.WXES1111 Prinsip Pengaturcaraan Berorientasikan Objek\t3\n"
<<"7.WXES1112 Matematik Pengkomputeran 1\t3\n";
if (cgpa<=2.0)
{
int n,counter;
cout<<"You can select less than or equal to 18 credits hours:";
cin>>n;
counter=counter-sub[n+1];


}
else
cout<<"You can select more than 18 hours:";

}

void subject::print()
{
}

void main()
{
char n[20],m[10];
double c;
cout<<"Name:";
cin>>n;
cout<<"Matric number:";
cin>>m;
cout<<"CGPA:";
cin>>c;
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
This program still not completed. So give me some tips. Thank
This is urgent assignment
Are there have to use string,cstring, array,........or other
I need you quick reply
I am very appreciate it
Thank you :rolleyes:

Recommended Answers

All 2 Replies

Think harder.

Think harder.

I already think it hard la....................
Going to crazy........................ :sad:
:eek:
I want to die............................ :sad:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.