Sunday, July 12, 2009

Help me with a c++ program please?

hey i need a little help with a program, ill post part of the program and then ask my question





#include%26lt;iostream%26gt;


#include%26lt;string%26gt;


#include%26lt;fstream%26gt;





using namespace std;





class Course{


string name;


char grade;


int hours;


public:


string ("") in the default constructor.


Course(){


name = "";


grade = "";


hours = 0;


}


Course(string n, char g, int h);





void setName(string n){name=n};


void setGrade(char g){grade=g};


void setHours(int h){hours=h};





string getName(){return name};


char getGrade(){return grade};


int getHours(){return hours};





void print(){


if (name != ""){


cout.width(10); cout%26lt;%26lt; name;


cout.width(4); cout %26lt;%26lt; grade;


cout.width(4); cout %26lt;%26lt; hours %26lt;%26lt; endl;


}


else


cout %26lt;%26lt; "....." %26lt;%26lt; endl;


}


};


class Student{


string last,first,street,city,state,zip,major,m...


int id;


int num_classes;


Course classes[15];


int hours_att, hours_earned, grade_points;


double gpa;

Help me with a c++ program please?
can you tell me what happens when you run it

baseball cards

No comments:

Post a Comment