Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1- Write a Java program with a Class called Vehicle which includes the following

ID: 3912028 • Letter: 1

Question

1- Write a Java program with a Class called Vehicle which includes the following: Three instance variables Color (string), TankCapacity, rangel integers) ( all private) - Constructor to initialize these variables Set method to set values of variables Get methods to return the three instance Variables Public Method to return mpg (miles per gallon - divide range/TankCapacity) - Run the class with a TestVehicle main class which creates two objects Prius: with the following properties: color white, TankCapacity 12 gallons, Range 600 FordRanger: with the following properties: Color green, tankCapacity 15 gallons, range Note: Use the constructor to set above properties miles 400 miles Run the program and use printf to output as below color Tank Cap Range 600 Vehicle mpg Prius Ford Ranger White Green 12 15 50 26 400 Also: Prompt the user to enter values from Key board to set the instance variables using the set methods. Write a program to prompt student for their name then test 1 grade, test 2 grade, test 3 grade. Calculate the average grade and print a statement such as: "Student name your grades are: Test1- grade1 Test2 grade 2 Test3 grade 3 Average ave 2- Use printf to format average to 1 place after decimal point Note: declare all grade variables double, and name variable as string

Explanation / Answer

1.

// Vehicle.java

// TestVehicle.java

2.