Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program that displays car information and the cost of their consumption it has manufacture, model number and consumption efficiency. There are two

image text in transcribed
image text in transcribed
Write a Java program that displays car information and the cost of their consumption it has manufacture, model number and consumption efficiency. There are two types of cars electric car and petrol car. An electric car specifies the battery level and the moved distance while the petrol car specifies the fuel level and the moved distance. The cost of the consumption is the consumed petrol or electricity times the cost of 1 gallon of petrol or 1 kilowatt of electricity. The cost of 1 gallon of petrol is OMR 0.985, while the cost of 1 kilowatt of electricity is OMR 0.03. The consumption is the efficiency times the moved distance. If the consumption is more than the battery level or fuel level then a message should be displayed "No Sufficient Fuel" or "No Sufficient Battery". The consumption efficiency of the petrol car is measured in gallon/kilometer while for the electric car is measured in kilowatt/kilometer. Assume that distances are in kilometers. Car Electric Car Petrol Car while for the electric car is measured in kilowatt/kilometer. Assume that distances are in kilometers Car Electric Car Petrol Car According to this description and the concepts of OOP, do the following

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

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

What is a businesss cost structure?

Answered: 1 week ago

Question

7. General Mills

Answered: 1 week ago

Question

3. Describe the strategic training and development process.

Answered: 1 week ago