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
egoroff_w [7]
3 years ago
9

Write a class named ParkingMeter containing: Two instance variables named timeLeft and maxTime of type int. The value of timeLef

t should be initialized to 0. A constructor accepting a single integer parameter whose value is used to initialize the maxTime instance variable. A method named add that accepts an integer parameter. If the value of the parameter is equal to 25, the value of timeLeft is increased by 30; otherwise no increase is performed. Furthermore, the increase occurs only if the value of timeLeft will not exceed the value of maxTime. add returns a boolean value: true if timeLeft was increase, false otherwise. A method named tick that accepts no parameters and returns no value. tick decreases the value of timeLeft by 1, but only if the value of timeLeft is greater than 0. A method named isExpired that accepts no parameters. isExpired returns a boolean value: true if the value of timeLeft is equal to 0; false otherwise.
Social Studies
1 answer:
Zigmanuir [339]3 years ago
3 0

The answer for the given question is explained below.

<u>Explanation</u>:

public class Parking Meter  

{  

int time Left = 0;

int max Time;  

public Parking Meter( int max ){  

max Time = max;  

}  

public boolean add ( int coin )  

{  

  if ( coin == 25 )  

  {

   if ( time Left + 30 < max Time )

   {

    time Left += 30;

    return true;

   }

  }  

  return false;  

}  

public void tick()  

{

if ( time Left > 0 )

{

 time Left -= 1;

}  

}  

public boolean  is Expired()  

{

return time Left == 0;  

}

}

You might be interested in
As she gazed across the plain, a ________________ filled her nostrils. Which phrase will give the sentence a peaceful tone?
yaroslaw [1]

Answer:

pleasant aroma (or just aroma if you only can use one word)

Explanation:

A pleasant aroma describes an enjoyable or pleasing smell. Usually, actions associated with feelings of joy or pleasure are peaceful.

I hope this helped!

3 0
3 years ago
Life Expectancy in Medieval England because of the plague
lina2011 [118]

Answer: out of every hundred people, 35-40 could expect to die. The life expectancy was under 29 years...half of what it had been in 1300

Explanation:

8 0
3 years ago
Tammy and maureen enjoy a glass of wine with dinner. after the meal, each women has a cigarette with a cup of coffee. how many p
Scrat [10]
What did the women have?

wine
food
cigarette
cofee

A psychoactive drug is a chemical substance that influences our brains, how we think and feel. 

We can't know what was in their food, so we can't exclude the  possibility that some psychoactive drug was there, but we know for sure that they consumed alcohol, tobacco and caffeine (in cofee) - at least three psychoactive drugs.
5 0
3 years ago
Why are the Phoenicians so important to study?
loris [4]
The first one and the second one. Hope this helped! : )
3 0
3 years ago
Analyze the impact each explorer (Cortes and Pizarro) had on the people he conquered, by explaining how the economy and the live
Liula [17]
I briefly learned about the Aztec and Inca's and from what I know, Cortes and Pizarro were both Spanish conquistadors. Cortes conquered the Aztec empire brutally, killing many common people as well as soldiers, much of Aztecs wealth was taken away and the Aztec people lived under Spanish rule for approximately 300 years. 

I suggest reading back into your lesson and taking notes; it helps a lot! 
8 0
4 years ago
Read 2 more answers
Other questions:
  • Once convicted, socrates was expected to _____ at the next stage of his trial
    10·1 answer
  • In which of the following cases did the court state that the name given to a damages cause by the parties has only slight weight
    15·1 answer
  • Write True Or False . If False write why
    5·2 answers
  • Outlines use to identify various levels of information
    6·1 answer
  • Brain-imaging studies have revealed increased dopaminergic activity in the _____ when heterosexual men look at pictures of attra
    9·1 answer
  • Which of the following is an example of human systems in the Amazon?
    13·1 answer
  • Answer these questions in det
    13·1 answer
  • What would happen if krill were removed from the aquatic
    14·1 answer
  • Which type of theatre objects to the dominant culture's control and demands that a minority culture's voice and political agenda
    15·1 answer
  • Which of the following is NOT a complaint about New Deal programs?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!