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.
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.