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]
2 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]2 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
what does the long-run expansion path look like if one input is regressive? can both inputs be regressive? why?​
trasher [3.6K]
I don’t know answer it yourself bro
7 0
1 year ago
Which activity is an example of a scientist using creativity?
slamgirl [31]
<span>a scientist exploring evidence from other fields of science to support findings</span>
6 0
2 years ago
Read 2 more answers
In an experiment examining the effects of size of plate on amount of food eaten, one group of participants is measured after eat
serious [3.7K]

Answer:

Within subject

Explanation:

A within study design is also called the repeated measures design. Here we use the same participants twice or more to test the same condition. Every one on the participants are made to test all conditions.

From this question, we can see that same group of participants participated twice in the study, first after eating on 12 inch plate, secondly after using the 10 inch plate.

5 0
2 years ago
Choose the sentence that is punctuated correctly. "somebody said no to me!" wailed the three-year-old boy in desperate frustrati
Aloiza [94]

There were three choices to choose from and the sentence that is punctuated correctly is the following:


"Somebody said 'No' to me!" wailed the three-year-old boy in desperate frustration when the scissors were taken from him.


Note:

When a quotation or title is included inside a quotation, the inner quotation marks should be changed to single marks. Confusing but read the sentence over and over again to understand and see the difference.


3 0
2 years ago
Along the northwestern coast of the United States, the Juan de Fuca Plate is being pushed underneath the North American Plate, c
alexdok [17]

Answer: Along the northwestern coast of the United States, the Juan de Fuca Plate is being pushed underneath the North American Plate, causing magma to rise to the surface. Magma that reaches the surface and cools will often build up a mountain over time.

Explanation The Juan de Fuca plate is being pushed underneath the North American Plate. Causing magma to rise to the surface. Magma that reaches the surface and cools will form a mountain

Magma is mostly found in a huge underground pockets. Magma that reaches the surface of the earth is referred to as lava, when it cools and hardens, it forms igneous rock. Temperatures hot enough to melt rocks are usually found only deep inside the earth.

8 0
2 years ago
Read 2 more answers
Other questions:
  • About what fraction of the globe did Communists control by 1975?
    15·2 answers
  • Marcia is teaching denise how to clean a kitchen. she taught her how to rinse dishes and put them in the dishwasher, how to wipe
    11·1 answer
  • Tamosin has a hard time remembering names. One night at a party, she met a man whom she wanted to impress. In order to remember
    12·1 answer
  • Using the accompanying map of the San Andreas Fault, and the knowledge that earthquakes occur about every 200 years in this area
    7·1 answer
  • In a paragraph, explain how social and economic conditions for African Americans differed in the Upper South and the Deep South
    9·2 answers
  • One morning, Miles accidentally dropped a thumbtack on the chair of the office manager where he worked. The office manager sat o
    9·1 answer
  • A producer for a cable news show is feeling insecure. She complains to her boss that she isn’t very smart and that she only does
    11·1 answer
  • Many researchers today believe that make-believe play __________. A) is not nearly as important as Piaget thought B) not only re
    10·2 answers
  • Carefully review the research matrix presented below. If this is a within subjects design, how many total participants will be u
    10·1 answer
  • How did trade along the Silk Road influence mathematics throughout Eurasia?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!