Answered step by step
Verified Expert Solution
Link Copied!

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 2- 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-150, 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:
image text in transcribed

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

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions