Question: Objective: Demonstrate your understanding of basic Java constructs for input, process and output. This assignment is based on the material covered in chapter 9 of

Objective: Demonstrate your understanding of basic Java constructs for input, process and output. This assignment is based on the material covered in chapter 9 of your textbook and the material covered on algorithms Please do not use break, continue/exit, return Documentation: See your course syllabus addendum file in Canvas for the required heading documentation and other notes. Make sure you have the header section properly created using tags such as @author, @file, etc Write a java program for the question below, Save the file with the following format LastNameFirstNameCit130Hw8A.java Deliverable: Submit your Java file. Use the file format: LastNameFirstNameCit130Hw8A.java for your file name. NOTE: Java class names must begin with a capital letter (i.e.,FooBarCIT130HW#.java) Submit your file to the assignment dropbox in Canvas Please dont forget to submit UML Assignment: Part 1 Design the UML Diagram: Draw the UML diagram for a Vehicle class based on the requirements outlined in Part 2 below. Save it as lastNameFirstNameUML.docx Part 2- Define the Vehicle Class: Design and write the definition of the Vehicle class named LastName(initial)FirstName(initial)Cit130Vehicle.java Example if first name is John and last name is Smith then the class name will be SLCit130Vehicle.java with the following public datafields: Make , model, year, mileage, fuel type. Create a no-arg constructor to initialize these fields with default values (refer to the Sample Run) Create a second constructor that takes only the model, year, and mileage as parameters and initialize the variables. Create a third constructor that initializes all the data fields Implement a method that calculates and returns the age of the vehicle by subtracting the vehicles year from the current year. The user will input the current year Create a method that displays all the vehicle information, including the age. (Hint: Call the method that calculates the vehicles age inside this method.) Implement a print method that displays the model, year, and mileage. Part 3- Write a Test Class that include the main method: save it as LastNameFirstNameCit130TestHw8A.java - Show how to create and display information for an object using the no-arg constructor. - Use hardcoded data to create and display an object using the third constructor (without prompting the user for input). Please see sample run - Create a loop to enter vehicle details using user input -prompt the user to enter model, year and mileage - Create a second constructor object and - use print to display model, year and mileage - Ask if the user would like to enter another vehicle detail, please see sample run Save the class with LastNameFirstNameCit130Hw8A.java Note: You can have all classes in one file and have one name for the program as the following LastNameFirstNameCit130Hw8A.java Sample Run: Using default data: Enter current year for model: Camry 2024 Make: Toyota Model: Camry Year: 2000 Mileage: 100 Fuel Type: Gas Age: 24 years Hardcoded data: Enter current year for model: Model S 2025 Make: Tesla Model: Model S Year: 2022 Mileage: 15000 Fuel Type: Electric Age: 3 years Enter vehicle details: Model: Honda Year: 2018 Mileage: 55000 Vehicle Details: Model: Honda Year: 2018 Mileage: 55000 Would you like to enter another vehicle? (yes/no): yes Enter vehicle details: Model: Toyota Year: 2016 Mileage: 150000 Vehicle Details: Model: Toyota Year: 2016 Mileage: 150000 Would you like to enter another vehicle? (yes/no): no Thank you for using the Vehicle Manager! Press any key to continue ... LastNameFirstNameCit130TestHw8A.java
- Show how to create and display information for an object using the no-arg constructor.
- Use hardcoded data to create and display an object using the third constructor (without prompting the user for input). Please see sample run
- Create a loop to enter vehicle details using user input
-prompt the user to enter model, year and mileage
- Create a second constructor object and
- use print to display model, year and mileage
- Ask if the user would like to enter another vehicle detail, please see sample run
Save the class with LastNameFirstNameCit130Hw8A.java
Note:
You can have all classes in one file and have one name for the program as the following LastNameFirstNameCit130Hw8A.java
Sample Run:
Using default data:
Enter current year for model: Camry
2024
Make: Toyota
Model: Camry
Year: 2000
Mileage: 100
Fuel Type: Gas
Age: 24 years Write a java program for the question below, Save the file with the following format LastNameFirstNameCit130Hw8A.java
Deliverable: Submit your Java file. Use the file format: LastNameFirstNameCit130Hw8A.java for your file name. NOTE: Java class names must begin with a capital letter (i.e.,FooBarCIT130HW\#.java) Submit your file to the assignment dropbox in Canvas
Please don't forget to submit UML
Assignment:
Part 1- Design the UML Diagram:
Draw the UML diagram for a Vehicle class based on the requirements outlined in Part 2 below. Save it as lastNameFirstNameUML.docx
Part 2-
Objective: Demonstrate your understanding of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!