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
Mark knows that he is an excellent liar but he doesn't feel very good about himself in general. Mark is likely to score _____ on
Pavlova-9 [17]

Answer:

High on self esteem

High on self efficacy

Explanation:

self-esteem is used to describe a person's overall sense of self-worth or personal value. In other words, how much you appreciate and like yourself while Self-efficacy reflects confidence in the ability to exert control over one's own motivation, behavior, and social environment. Mark will score high on both because he seems to be convinced about how excellent he is at lying.

4 0
4 years ago
Read 2 more answers
What two main political groups existed in the colonies in the 1770s
Tom [10]
<span>The two main political groups that existed in the colonies in the 1770's were the Patriots and the Loyalists. The Loyalists wanted to stay under British rule, while the Patriots wanted to break away from it and be independent.

</span>
7 0
4 years ago
Read 2 more answers
Type the correct answer in the box. Which major city in the Soviet Union suffered under Germany’s blockade? The Soviet city of w
nikitadnepr [17]

Answer:

Explanation:

Siege of Leningrad

After the Nazis invaded the Soviet Union in the summer of 1941, a German army surrounded the city of Leningrad in an extended siege beginning that September.

3 0
4 years ago
Why did European exploration of the Western Hemisphere accelerate in the late 15th century?
mestny [16]
Improvements in sails, ship hulls, and navigation equipment
8 0
4 years ago
Read 2 more answers
William Cooley is the manager of a professional football club. He bases his relationship with the players on aspects such as fri
attashe74 [19]

The correct answer would be, Consideration Behavior.

William Cooley is the manager of a professional football club. He bases his relationship with the players on aspects such as friendship, mutual trust, respect and warmth in the relationship. Here, William is displaying Consideration Behavior.

Explanation:

Consideration Behavior is a behavior that help people in working towards a mutual goal.

This Consideration Behavior focuses on people. This behavior exhibited by someone is usually based on respect, friendship, trust and warmth towards the people who are there to achieve the common goal.

So when William Cooley builds his relationship based on such factors with the players of his team, it means he is exhibiting Consideration Behavior towards achieving a common goal, which is to win the football match.

Learn more about Behavior at:

brainly.com/question/1176009

#LearnWithBrainly

8 0
3 years ago
Other questions:
  • In Russia, after the Soviet Union collapse, influential ________ retained power by acquiring large numbers of ________ , so the
    11·1 answer
  • This is a federal agency begun in 1970 by president nixon to protect human health and the air.
    5·1 answer
  • Dr. Joseph thinks most people are generally trusting of strangers. He did a study at his university in the United States to test
    12·1 answer
  • Which of the following concepts is more frequently associated with Adam Smith and his 1776 magnum opus "An Inquiry into the Natu
    10·1 answer
  • #1 | There are two people near the river and both of them want to get to the same side, but the boat can only take one person ac
    14·1 answer
  • The goldsmith's ability to create money was based on the fact that a. paper money in the form of gold receipts was rarely redeem
    10·1 answer
  • Why do you think the persians allowed the people they conqured to gonvern themself?
    6·1 answer
  • ¿Existen más parques nacionales en el mundo?
    12·1 answer
  • China has unveiled five new national parks, in part to conserve what animal, whose numbers have increased to around 1,800 in the
    12·1 answer
  • Answer fast
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!