Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 2 - Classes Overview The purpose of this assignment is give you some experience writing classes in C + + , the various special
Lab Classes
Overview
The purpose of this assignment is give you some experience writing classes in C the various special functions they make use of such as copy constructors, assignment operators, and destructors as well as an introduction to dynamically allocating memory within those classes.
New Keywords Language concepts
Classes conceptually similar to other languages
The std::vector class similar to Java's ArrayList class, an expandable container
The std::string class similar in many ways to strings in most every language
Description
This program will represent a hypothetical car dealership, which consists of showrooms that contain the vehicles for sale. To that end, there are three classes you will be writing:
Vehicle
Showroom
Dealership
For this assignment, main.cpp will be provided for you, so you don't have to worry about the structure of the program. Instead, you can focus solely on the structure of the classes and their interactions.
Vehicle
The Vehicle class is the basic container of this assignment. You will need to store the following data as private data members of the class:
A std::string to store the make of the vehicle such as Mazda, Toyota, etc
A std::string to store the model of the vehicle such as Mustang, Model S F etc
An unsigned integer to store the year
A float to store the price
An unsigned integer to store the number of miles the vehicle has been driven
In addition to these data members, you should have the following public functions:
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