Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(my error message is line 27 #includeGradeBook.h no such file or directory) I'm using codeBlock. can anyone help me understand what am I missing ?

(my error message is line 27 #include"GradeBook.h" no such file or directory) I'm using codeBlock. can anyone help me understand what am I missing ?

(Modifying Class GradeBook) Modify class GradeBook (Figs. 3.113.12) as follows:

a) Include a second string data member that represents the course instructors name.

b) Provide a set function to change the instructors name and a get function to retrieve it.

c) Modify the constructor to specify course name and instructor name parameters.

d) Modify function displayMessage to output the welcome message and course name, then the string This course is presented by: followed by the instructors name.

Use your modified class in a test program that demonstrates the classs new capabilities.

image text in transcribedimage text in transcribed

I wrote the program as follow (my error message is line 27 #include"GradeBook.h" no such file or directory)

#include

using std::string;

class GradeBook { Public: GradeBook (string,string) void setCourseName(string); string getCourseName ();

void setInstructorName(string); string getInstructorName();

void displayMessage();

private: string courseName; string instructorNmae;

};

#include

using std::cout; using std::endl; #include"GradeBook.h"

#include using std::cout; using std::endl;

#include "GradeBook.h"

GradeBook::GradeBook(string course, string instructor) { setCourseNmae(course); setInstructorName(instructor);

}

void GradeBook::getCourseName(string name) { courseName=Introduction to Engineering and Computing; }

string GradeBook::getCourseName()

{ return courseName;

}

void GradeBook::setInstructorName(string name)

{ instructorName=Professor XY ; }

string Gradebook::getInstructorName() { return instructorName; }

void GradeBook::displayMessage()

{ cout

}

int main() { GradeBook gradebook("Introduction to Engineering and Computing");

cout

couit 1 // Fig. 3.12: GradeBook.cpp 2 // GradeBook member-function definitions. This file contains 3 //implementations of the member functions prototyped in GradeBook.h. 4 #include 5 #include "GradeBook.h" // include definition of class GradeBook 6 using namespace std; 7 8 // constructor initializes courseName with string supplied as argument 9 GradeBook: :GradeBook( string name ) 10 : courseName name // member initializer to initialize courseName // empty body 12 13 // end GradeBook constructor 14 15 //function to set the course name 16 void GradeBook::setCourseName ( string name) 17 18 19 // end function setCourseName 20 21 /function to get the course name 22 string GradeBook::getCourseName const 23 24 25 // end function getCourseName 26 27 // display a welcome message to the GradeBook user 28 void GradeBook: :displayMessage O) const 29 30 courseName = name ; // store the course name in the object return courseName; // return object's courseName // call getCourseName to get the courseName cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions

Question

5. Describe the visual representations, or models, of communication

Answered: 1 week ago