Question: intermediate c++. please write code following the requests and guidlines in the first two images. submit code alongside output as shown in the third and



Assignment 1 - Student Class Make sure you have read and understood the chapter this week before submitting this assignment. Hand in your program with code on top and output at the bottom in a txt file. Pointers in a class Every programming assignment is as much a test of English language comprehension as it is a test of programming or mathematical skills. This week, the explanations of the requirements below are given clearly in plain English if you read carefully. However, if there is any question about what is being asked, you are urged to ask for clarification in the public forums. Understand the Problem When students take classes, their transcript must contain the class number and name of the class. Classes are a great way to encapsulate information that will be needed by the main. Our new class will also include an overloaded assignment Program Spec Student class This class has the following data fields: name. A string that stores the name of the student numCourses - An integer that tracks how many courses the student is currently enrolled in courseList - A dynamic array of strings used to store the names of the courses that the student is enrolled in Create the following methods: two versions of the constructor default and one that accepts all three member variables. The default name is "no name" . mutator and accessor functions for the class String display() is a function that returns a string that contains the name, the number of courses, and the list of all Coses. If there are no coursesditeshould display No courses with the name and number courses. If there are no courses, it should display "NO Courses with the name and number void resetAll(), is method that resets the number of classes to 0 and the courselist to an empty list. An overloaded assignment operators that correctly makes a new copy of the student records. A destructor that releases all memory that has been allocated. Main() . Our main() will create two Student objects. The first one that asks the user for information. The second should be created using the default constructor and then copy the first to the second using the overloaded= assignment operator. . To get the data, use the following methods string getCourses(int &nCourses), is a function that gets the list of course names from the user. This can be as many as they want. It will return the dynamic array of strings that will then be put into the Student class object. This funttion will have to support input for an arbitrary number of courses, so you will need a symbol that stops the function. nCourses can be set to the number of courses that the user enters, which is actually changing the value in the main, so it acts like a second return. string getName(), will get the name of the student to be put in to the class. It should not return unless it has at lease 3 letters in the name. Spaces are allowed. Be sure to enter bad data for testing. Display all values for the first Student object Copy to the second Student object and then display it. . For the second Student only test the mutators with both good and bad info inside of IF.else statements for the name and one of the courses. Display both first and second Students again, . For the first Student object, call resetAll) and then display again to make sure there are courses listed. . Sample output Run Enter the next course name or to finish with course names: CS 2B The entered class name is : CS 28 Sample output: Run Enter the next course name ore to finish with course nomes CS 2B The entered class name is : CS 28 Enter the next course name or to finish with course names: Math 1A The entered class name is : Math 1A Enter the next course none or to finish with course names: Biol 10 The entered class name is : Biol 10 Enter the next course name ore to finish with course names: Enter the name for the student: ag Bad data, enter again with at least 3 letters. Enter the name for the student: Mr. Cecil Output for data entered: Mr. Cecil 3 courses CS 28 Moth LA Biol 10 Copied to second Student class using the operator, display: Mr. Cecil 3 courses CS 28 Math LA Biol 10 Testing mutators Enter a new name for the second Student: th Bad dato, enter again with at least 3 letters. Enter the name for the student John Smith 3 courses CS 2B Math 1A Biol 10 Copied to second Student class using the = operator, display: Mr. Cecil 3 courses CS 2B Math 1A Biol 10 Testing mutators: Enter a new name for the second Student: th Bad data, enter again with at least 3 letters. Enter the name for the student: John Smith Enter a new course for the first one in the list: HLTH 21 Output for the first Student: Mr Cecil 3 courses CS 2B Math IA Biol 10 Output for the second Student: John Smith 3 courses HLTH 21 Math 1A Biol 10 After the first Student is reset: no name courses No courses
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
