Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please don't forget to add total number of cars entered Public Interface of the CarPricing Class - The CarPricing class allows the user to start
Please don't forget to add total number of cars entered
Public Interface of the CarPricing Class - The CarPricing class allows the user to start entering car properties and options at a used cars dealership with the objective of describing available car properties, computing their total cost, computing the total car prices, and total number of cars processed for pricing, as decibed in the public interface, below. - As in the real car dealing, car year manufacture and car options play a major role in detrmining the car price - The class public interface has the following methods: - init constructor method: initializes all instance variables for the number of cars processed, car properties (make, model, year), car options (includes one or more of the following: Sunroof, Stereo, Camera System, Leather Seats, Automatic Seats, Laser System), and total car cost - computeCost method: computes the currently processed car total cost given its basic price plus the price of options, and whether the car is new or old, with the following details: - All options cost 2000, each, except for Leather Seats and Sunroofs, which cost 4000, each. - If the car is a new car, in the sense that it was made in the years 2020,2021 , or 2022, then the car price goes up by 10000 Riyals. - computeNumCars method : adds 1 to the total count of processed cars - printProperties method : prints all car properties and also prints the basic cost of the car that is currently being processed - printoptions method : prints all the options of the car that is currently being processed - get TotalCost method : returns the car computed total cost, for the car that is currently being processed - getTotalCars method : returns the total number of cars processed (so far) for pricing - clear method : clears all instance variables - Three sample runs are shown - When your code is received, it will be tested using code with the same public interface (below) and your code must produce the same results that are shown - Your code must be self-contained, in the sense that it must include all the data that is needed at run time and must NOT require the user to enter any data. \# Sample runs of the code. When your code is submitted it should produce the same results that are shown, below, \# given the input data values that you can see in the sample runs, below Honda Accord 2021 Basic Cost =70000 Car Options Sunroof Stereo Camera System Leather Seats Car total price =92000 Sum of processed car prices =92000 Total number of processed car prices =1 Toyota Camry 2020 Basic Cost =55000 Car Options Stereo Camera System Car total price =69000 Sum of processed car prices =161000 Total number of processed car prices =2 Honda Civic 2020 Basic Cost =60000 Car Options Sunroof Stereo Camera System Leather Seats Laser System Car total price =84000 Sum of processed car prices =245000 Total number of processed car prices =3Step 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