1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
garri49 [273]
4 years ago
10

Implement a class Car with the following properties. A car has a certain fuel efficiency (measured in miles/gallon) and a certai

n amount of fuel in the gas tank. The efficiency is specified in the constructor, and the initial fuel level is 0. Supply a method drive that simulates driving the car for a cartain distance, reducing the fuel level in the gas tank, and methods getGasLevel, to return the current fuel level and addGas, to tank up. Sample usage:
Car myHybrid = new Car(50); //50 miles per gallon
myHybrid.addGas(20); // Tank 20 gallons
myHybrid.drive(100); // Drive 100 miles
System.out.println(myHybrid.getGasLevel()); // Print fuel remaining.
Computers and Technology
1 answer:
nika2105 [10]4 years ago
8 0

Answer:

See explaination

Explanation:

class Car

{

private double drdist;

private double fuel;

private double mpg;

public Car(double m)

{

mpg = m;

fuel = 0;

}

public void addGas(double add)

{

fuel = fuel + add;

}

public void drive(double d)

{

drdist = drdist + d;

mpg = fuel * mpg / d;

}

public double getGasLevel()

{

return fuel;

}

}

public class Carfuel{

public static void main(String []args){

Car myHybrid = new Car(50); //50 miles per gallon

myHybrid.addGas(20); // Tank 20 gallons

myHybrid.drive(100); // Drive 100 miles

System.out.println(myHybrid.getGasLevel()); // Print fuel remaining.

}

}

You might be interested in
There are three managerial skills listed that a good administrative medical assistant (MAA) should prosses
Yuliya22 [10]
Ask for detalls follow report
5 0
4 years ago
Personal Area Network (PAN--
Allushta [10]

Answer:

All of given terms are Categories of Wireless networks.

Explanation:

Wireless networks as obvious from name are the networks having no means of physical medium such as cords, wires or cables. This gives the advantage of mobility and extension of the applications to different parts of building, block and even anywhere in word. Wireless network can be divided into four basic categories in order to differentiate between there quality and range:

                     <u>Category                                                           Coverage</u>

  • Wireless Personal Area Network (WPAN)          |   Within One person
  • Wireless Local Area Networks (WLAN)               |    Within a building
  • Wireless Metropolitan Area Networks (WMAN)  |   Within a city
  • Wireless Wide Area Networks (WWAN)              |     Worldwide

     

i hope it will help you!

4 0
3 years ago
which of the following will not be considered in improved business performance planning ? A. bussines profitability B.. Ignoring
adelina 88 [10]

Among the following option B. Ignoring new idea will not be considered in improved performance planning.

<h3>What is buisiness performance planning?</h3>

Performance planning is the term used to describe a <em>company's systematic process for determining and preparing an individual's or organization's goals</em>, as well as the most effective means of achieving them. Both <em>the company and the employee</em> participate in the planning process through a formal plan called the development plan.

A company must successfully utilize new ideas in order to <em>advance its operations, introduce fresh goods and services to the market, boost productivity, and, most significantly, raise profits.</em>

<em />

So, new ideas must not be ignored .

Learn more about buisiness performance planning here brainly.com/question/25922327

#SPJ10

6 0
2 years ago
What is typeface
Mademuasel [1]
I’m so bored and hungry answer is c 3566
4 0
3 years ago
Read 2 more answers
4. UPS stands for Uninterrupted Power Supply . (Yes /no
ser-zykov [4K]

Answer:

4)true

5)no(not good for computer )

6)easy

4 0
3 years ago
Other questions:
  • Secondary storage devices that are input and output devices include all except:
    10·1 answer
  • Why are video texts an example of multimedia? A. They use audio and visual elements together. B. They use one type of medium to
    13·2 answers
  • On an Android device, where can a user find the correct app to use to sync contacts and apps among devices?
    10·1 answer
  • One of your clients is looking into investing in direct participation programs. He is examining several different types of progr
    13·1 answer
  • -How long does a copyright last?
    6·1 answer
  • To cope with the uncertainty about how their pages will be viewed, many web page designers opt to use _________ units, which are
    13·1 answer
  • The alveolar walls and the pulmonary capillaries form the:
    5·1 answer
  • Where is the fill handle located
    7·1 answer
  • Who would win in a fight, Noble 6 from halo reach or Master Chief??
    6·2 answers
  • Which would you use to get the number of elements in a dictionary?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!