10 30 Marks Course Class Student Class Implement Classes Student Course Defined Follows Co Q37059721

10. [30 marks] (The Course class and Student class) Implementthe classes Student and
Course which are defined as follows,

// Course.h
#ifndef COURSE_H
#define COURSE_H
#include <string>
#include <iostream>
using namespace std;
class Student
{
public:
// Default constructor, creates a student with id 0 and name anempty string
Student();
// constructor, creates a student with the specified id andname.
Student(int id, const string& name);
// Returns the student name.
string get_name() const;
// Returns the student id.
int get_id () const;
// Sets the student name.
void set_name(const string& name);
// Sets the student id.
void set_id(int id);
// Prints the student id and name.
void print_student() const;
private:
// student name
string name;
// student id
int id;
};
class Course
{
public:
// Creates a course with specified name and maximum

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.