answer.
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]
1 year 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]1 year 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
Your niece loves to play peek-a-boo. the way that you like to play is to put your blanket over your face and after a few seconds
Andru [333]
The answer is object permanence.

Object permanence refers to the ability to understand that an object is still present and physically exists even if it is hidden out of sight. In this example, your niece lacks object permanence since she does not understand that you are behind the blanket even though you cover yourself with it or you are temporarily. 
5 0
1 year ago
The adage most appropriate to memory function and aging is
shusha [124]

The correct answer to this open question is the following.

The adage most appropriate to memory function and aging is "use or lose it."

That is why it is so important to continually exercise the memory function so the brain never loses its ability to do something previously learned. You use it and you practice it so you master. Mastery is the result of constant repetition. So it is better to use something to be fresh in the memory and could be used when needing it.

7 0
1 year ago
Read 2 more answers
According to erikson, children have _____, and thus believe that they can achieve any goal
ss7ja [257]

The answer in the provided question above is an unrealistic self concept in which their ways or things that they believe aren’t real as what mature or much older people seem which led children to have impossible ideas and a means of belief that they can do or achieve anything.

4 0
1 year ago
Mummy shaped amulet that held farm tools? Ancient egypt
Papessa [141]

Answer:

A shabtl is a mummy shaped amulet that held farm tools.

4 0
1 year ago
Read 2 more answers
7. The following Organizations can apply for the Baldrige Award except _________________ A. Schools B. Non-profits C. Small manu
geniusboy [140]

Answer:

d

Explanation:

utilities

6 0
1 year ago
Other questions:
  • Jennifer Burroughs is thinking about starting a firm in the upscale women's fashion industry. To get a full appreciation of the
    5·1 answer
  • In ______, the Fourth International Russell Tribunal of 1979 found that the government was perpetrating genocide against the ind
    6·1 answer
  • sues for "aesthetic pollution." The basis for his suit is Kyle's habit of wearing clothes Kennedy considers ugly. Kennedy's comp
    9·1 answer
  • If disclosure of a subject's involvement in a specific research study can be potentially harmful to the subject, and the consent
    14·1 answer
  • Write a class named ParkingMeter containing: Two instance variables named timeLeft and maxTime of type int. The value of timeLef
    9·1 answer
  • You are Steve Hewitt, City Administrator, and you have gone through training to use Vroom’s Time-Driven model of leadership styl
    7·1 answer
  • Kathryn has completed a study and rejected the null hypothesis when the null hypothesis was in fact true. Kathryn has made a ___
    12·1 answer
  • Stress hormones at the time of learning _____ new memory formation; the presence of stress hormones at the time of recall _____
    10·1 answer
  • Walking home, you find a wallet on the ground. Opening it, you find $540 in cash, a driver’s license, and a note saying, “If los
    5·1 answer
  • Show the differences between managed and unmanaged development? ​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!