inheritance problem

i need code for this problem so i can understand how its done:

A CollegeCourse class includes fields representing department, course number, credit hours, and tuition. Its child, LabCourse, includes one more field that holds a lab fee charged in addition to the tuition. Create appropriate functions for these classes, and write a main() function that instantiates and uses objects of each class. Save the file as Courses. cpp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

class CollegeCourse {
      //...
};

class LabCourse : public CollegeCourse {
      //...
};


int main() {

      LabCourse lab1;      // labcourse inherited college courses data publicy

      return 0;
}



You really need to learn inheritance and polymorphism by reading a book and not code from anonymous people online. Once you understand the rules and how it actually works than you can start coding away.
Topic archived. No new replies allowed.