Question: C + + modify these classes and write a driver program that combines them GradeBook.h: / / GradeBook class definition in a separate file from
C modify these classes and write a driver program that combines them
GradeBook.h:
GradeBook class definition in a separate file from main so that we may use this in all the programs now
#include
#include class GradeBook uses C standard string class
GradeBook class definition
class GradeBook
public:
constructor initializes courseName with string supplied as argument
explicit GradeBook std::string name
: courseName name member initializer to initialize courseName
empty body
end GradeBook constructor
function to set the course name
void setCourseName std::string name
courseName name; store the course name in the object
end function setCourseName
function to get the course name
std::string getCourseName const
return courseName; return object's courseName
end function getCourseName
display a welcome message to the GradeBook user
void displayMessage const
call getCourseName to get the courseName
std::cout "Welcome to the grade book for
getCourseName
std::endl;
end function displayMessage
void determineClassAverage const; averages userentered grades
private:
std::string courseName; course name for this GradeBook
; end class GradeBook
week program.cpp:
#include
#include
using namespace std;
void sortchar nm;
void displaychar name;
int main
char names;
int i;
for i; i; i
cout "Enter name of the student : ;
cin namesi;
sortnames;
displaynames;
return ;
void sortchar nm
char temp;
cout "Sorting names in Ascending Order endl;
for int i ; i ; i
for int j i; j; j
if strcmpnminmj
strcpytempnmi;
strcpynminmj;
strcpynmjtemp;
;
void displaychar nm
cout "Displaying names in Ascending Order endl;
for int i ; i ; i
cout nmi
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
