Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Kindly do it using C++ please provide valid code so that it produced the same output Programming Exercises 1. (Design a class for modelling courses)
Kindly do it using C++
please provide valid code so that it produced the same output
Programming Exercises 1. (Design a class for modelling courses) Suppose you need to process the information for a series of courses. Each course has a name and a number of students who take the course. You should be able to add/drop a student to/from the course. You can use a class to model the courses, as follows: Course -courseName: string -students: string The name of the course. An array of students who take the course. students is a pointer for the array The number of students (default: 0). The maximum number of students allowed for the cour course. -numberOfStudents: int -capacity: int +Course(courseName: string&, capacity: int) +-Course) +getCourseName(): string const +addStudent (name: string&): void +dropStudent (name: string&): void +getStudents(): string* const +getNumberOfStudents(): int const Creates a Course with the specified name and maximum number of students allowed. Destructor Returns the course name Adds a new student to the course. Drops a student from the course. Returns the array of students for the course. Returns the number of students for the course. The program source code (Course.h, Course.cpp, TestCourse.cpp) has been partly completed and is available on the VLE. There are some missing lines in the files (marked in the comments). Fill in the missing blocks of code to complete the program, then test it. An example of the output: Number of students in Data Structures: 0 Number of students in Database Systems: 0 Number of students in Data Structures: 3 Peter Jones, Brian Smith, Anne Kennedy Number of students in Database Systems: 2 Peter Jones, Steven Smith Number of students in Data Structures: 2 Brian Smith, Anne Kennedy Student Anne Kennedy is not on the Database Systems course - 0 X /** ** 1 DK > pass-to-function.cpp - Code::Blocks 20.03 File Edit View Search Project Build Debug Fortran wxSmith Tools Tools+ Plugins DoxyBlocks Settings Help t X = 49 C- 45: 4. Il li
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started