Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Language Problem A) (20 Points) Implement the Big Three for the CarMakeInventory Class and use them In lecture we will discuss the Course class
C++ Language
Problem A) (20 Points) Implement the Big Three for the CarMakeInventory Class and use them In lecture we will discuss the Course class to demonstrate the use of dynamic memory in classes, and the necessity of implementing a copy constructor, a destructor, and an overloaded version of the assignment operator (that is, the big three) when dynamic memory is used in a class. The Course Class and an example of its use has been posted on the class Moodle site, and we will go over it in Lecture. However, for this problem you will implement the big three in similar fashion as they are implemented in the Course class for a different class, the CarMakeInventory class. NOTE, there are differences between the two classes (Course and CarMakeInventory). You will have to account for the differences in your implementation of the methods, operators, and functions for the CarMakeInventory class. Constraints: ssary C++ code to the C++code that we Specifically, in this assignment you will add the nece posted on the class Moodle site for this assignment by defining and using following methods, operators, and functions for the CarMakeInventory class 1) when A Copy Constructor -creates a copy of an object of type CarMakeInventory it is passed "by value" to a function, or when a programmer wants to make a copy of an existing CarMakeInventory object by calling the copy constructor explicitly 2) A Destructor which deallocates the memory dynamically that was dynamically allocated when an instance of the class CarMakeInventory is created (e.g., the Problem A) (20 Points) Implement the Big Three for the CarMakeInventory Class and use them In lecture we will discuss the Course class to demonstrate the use of dynamic memory in classes, and the necessity of implementing a copy constructor, a destructor, and an overloaded version of the assignment operator (that is, the big three) when dynamic memory is used in a class. The Course Class and an example of its use has been posted on the class Moodle site, and we will go over it in Lecture. However, for this problem you will implement the big three in similar fashion as they are implemented in the Course class for a different class, the CarMakeInventory class. NOTE, there are differences between the two classes (Course and CarMakeInventory). You will have to account for the differences in your implementation of the methods, operators, and functions for the CarMakeInventory class. Constraints: ssary C++ code to the C++code that we Specifically, in this assignment you will add the nece posted on the class Moodle site for this assignment by defining and using following methods, operators, and functions for the CarMakeInventory class 1) when A Copy Constructor -creates a copy of an object of type CarMakeInventory it is passed "by value" to a function, or when a programmer wants to make a copy of an existing CarMakeInventory object by calling the copy constructor explicitly 2) A Destructor which deallocates the memory dynamically that was dynamically allocated when an instance of the class CarMakeInventory is created (e.g., the
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