Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java write a constructor for a new class called CarSale that brings in a vin as text, price as a double, and year as

In java write a constructor for a new class called CarSale that brings in a vin as text, price as a double, and year as an integer as parameters. Have it set variables for the class (you decide the variable names that are there, you dont need to declare them in this answer) with these parameters. Included exception handling and throw an exception if the price is less than 0 or if the year is less than 1970.

You are required to define a constructor of class CarSale, not define the class itself.

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_2

Step: 3

blur-text-image_3

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

What do you understand to be the meaning of turnover?

Answered: 1 week ago