PROG 24310: Inheritance, Polymorphism, Copy Constructors, Operator Overloading, Generic Programming - IT Assignment Help

Download Solution Order New Solution
Assignment Task:

Objectives: Inheritance, polymorphism, copy constructors, operator overloading, generic programming 

Question 1 Write a C++ program that maintains information regarding cars sold by a dealership. Assume that the dealership deals in old and new cars. Each car has a Vehicle Identification Number (VIN), a Make, a Model Year, List Price and Discount. The default value for discount is zero. For used cars, an additional information regarding the distance run by the car is also maintained. 

The sale price of cars is calculated as per following logic: 

• For new cars: Sale Price = List Price – Discount 

• For old cars: Sale Price = List Price – Discount - Depreciation. Assume that a used car depreciates by .3% for each 10,000 kM it has travelled. 

The program should: 

i. Define a class CarInventory to maintain car instances. Make sure the inventory does not allow multiple cars with the same VIN. [5 Marks]

ii. Define the classes to represent old and new cars, with required attributes, getters & setters, constructors. [10 Marks]

iii. Define functions to compute sale prices of new and old cars. [5 Marks]

iv. Add 4 cars (2 old and 2 new) to the CarInventory and use polymorphism to print the sale price of each car and the total sale price of all the cars. [5 Marks] 

Question 2 Refer to the class Fraction (Lecture-4b Introduction to Object Oriented Programming). Add the following operations to the class: 

1. Addition of two fractions using the + operator E.g. given Fraction f(3, 4), g(4, 3); f+g should give a fraction with numerator 25 and denominator 12

2. Addition of a fraction and an integer number using the + operator E.g. given Fraction f(3, 4); f+3 should give a fraction with numerator 15 and denominator 4.

This PROG 24310: IT Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.