Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE CODE USING C++ Please write in comments and show results. Files must be divided. Purpose is to work with with basic and aggregate or

PLEASE CODE USING C++

image text in transcribed

Please write in comments and show results.

Files must be divided.

Purpose is to work with with basic and aggregate or composite classes

Design a Course class that contains individual course information and has the following private attributes long string int courseNumber courseName numberOfCredits All class attributes must be private and accessed through public member functions. You need to write the following public methods Default constructor that sets courseNumber to 0, courseName to "", and number ofCredits to 0 Overloaded constructor that takes 3 parameters used to initialize the 3 attributes. Set function(s) that set the objects data. Print function that displays the object data in a neat fashion. - - After you design your class, write a main program that instantiates 2 Course objects, sets and displays their information as described below: For the first object 1. Ask the user to enter the course number, name and number of credits (the user 2. 3. should enter for example 21541, CS211, and 1 respectively) Create the object using the overloaded constructor (and the data from above). Call the print function to print the object data. For example Course Numbe 21541 Course Name Number of Credits: 1 CS 211 For the second obiect: 1. Create the object using the default constructor 2. Call the print function to display the second object's data. 3. Prompt the user to enter new data for the second object (for example 21345, 4. 5. CS331, and 3) Call the set function(s) to set the object's attributes to the user input. Call the print function to display the new object data. Note: You must divide your files into .cpp and .h file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions