Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Design a class named Car that contains . 6 data fields: make (String), model (String. colour(Strig.I Question 2 Write a test program that

image text in transcribed
Question 1 Design a class named Car that contains . 6 data fields: make (String), model (String. colour(Strig.I Question 2 Write a test program that Sets themarSpeed for crs to 22 in/h Creates a Car object with the default properties (L.e blu Creates a second Car object for a black Audi A3 with an Drives the Hyundai :30for 20km Refuels the Hyundai 130 fuel (double), odometer (int) and maxSpeed (int) Assume that all cars have the same maxSpeed (hint: make this a static variable) Hyundai 30 with 40 of fu A no-arg constructor that creates a blue Hyundai 130 with odometer value of 100km 40L of fuel. A constructor that creates a car with 55L of fuel and theDrives the Audi A3 for 175km specified make, model, colour and odometer value The getter and setter methods for make, model, colour, fuel, odometer and maxSpeed A method named refuel() that sets the fuel to 50L A method named drive) that increments the odometer by the specified distance and decrements the fuel at a rate of Prints the make, model,colour,fuel, odometer-and maxSpeed for the car with the greatest amount of fuel remaining model, colou, fuel, odometer value and . Prints the make maxSpeed for the car with the least amount of fuel remainin .51/100km

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

Step: 3

blur-text-image

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

Students also viewed these Databases questions