Create An Automobile Class For A Dealership Seek Your Dream /Tutorialoutletdotcom - PowerPoint PPT Presentation

} ?>
View by Category
About This Presentation
Title:

Create An Automobile Class For A Dealership Seek Your Dream /Tutorialoutletdotcom

Description:

FOR MORE CLASSES VISIT www.tutorialoutlet.com Write a program for the instructions given below: Create an Automobile class for a dealership. Include fields for an ID number, make, model, color, year, vin number, miles per gallon, and speed. Include get and set methods for each field. Do not allow the ID to be negative or more than 9999; if it is, set the ID to 0. Do not allow the year to be earlier than 2000 or later than 2017; if it is, set the year to 0. Do not allow the miles per gallon to be less than 10 or more than 60; if it is, set the miles per gallon to 0. Car speed should be initialized as 0. Include a constructor that accepts arguments for each field value and uses the set methods to assign the values. Also write two methods, Accelerate () and Brake (). Whenever Accelerate () is called, – PowerPoint PPT presentation

Number of Views:4
Slides: 4
Provided by: josbuttlewr119

less

Write a Comment
User Comments (0)
About PowerShow.com