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
In this unit, you learned about civilizations that once existed in Europe and the Middle East. You also learned about different
NemiM [27]

Answer:

There were 2 primary types of government, a democracy, and a hierarchy. A hierarchy had a few different variants, the ruler had all power and was a god, the ruler controlled people, and the ruler had the most power but had a small house of other "government officials"

If I had a kingdom, it would have a democracy as its government. A group of advisors, the house/senate, and what many think is the ultimate power but has equal power, the president/king. Democracy is important. Not too much though, or else you get communism. Now, things were different back then. Most people kept what they had, and the citizens ran their own "government" of sorts. But a democratic government is still needed to control, and maintain the people. When I say control, I don't mean "give me all of your money and earnings and we will give you what you earned in food, water, clothes, and a house." That's communism. What I mean by control, is enforce the rules, make sure that the people don't tear each other apart, limb from limb. The people need guided to the decided way of living, which THEY CHOSE by voting. Therefore, they chose to follow these guidelines, and should not argue. That is how to run a stable government. On paper. Of course, there would be plenty of people who want to cause problems, but those things are too unpredictable to handle without communism. Not saying that it is the only way to run a government, what I meant was those things will be deal with at the time and can't be fixed on a simple word document for a history lesson on a computer learning system meant for a sixth grader to answer in a few sentences, about why you should be good to people, and not meant to go into detail about communism, and meant to see who understands how to live a happy human life, and who knows how to be the next "president" of Russia, and also just to see students creativity and knowledge of world politics as well as their downright opinion. I probably went into a lot of detail but hit the word limit.

Explanation:

hope this helps

6 0
2 years ago
Dr. chen's patient has a severe phobia of crowded places. dr. chen plans to use systematic desensitization to help the patient.
adelina 88 [10]
Systematic desensitization as graduated exposure therapy,<span> that aims to remove the fear response of a phobia. The idea is to substitute the fear with a relaxation response to the conditional stimulus.</span><span>
Yes, Dr.Chen</span><span>'s treatment plan is likely the best one for the patient, because s</span>ystematic desensitization is  an effective treatment to reduce anxiety in individuals when exposed to fearful situations.
8 0
2 years ago
Read 2 more answers
The following map shows the Crusades from 1095 A.D (CE) through 1204 A.D (CE). Use the map to answer the following question: Map
zaharov [31]
Through followed a large and major river.....choice A.
3 0
2 years ago
What incentives might be provided to news media to encourage them to cover more substantive topics?
rjkz [21]
<span>Media networks often compete to be first. Insider information that results in the ability to present an article sooner than their competitors is a great incentive to cover topics of any niche. Accuracy is also key. If the insider information exposes accurate information, the media network is able to prepare their article without spending time checking facts.</span>
6 0
2 years ago
To research the claim that green tea lowers LDL (so-called bad) cholesterol, you ask a random sample of individuals to divulge w
Natasha2012 [34]

The correct answer is D.

<u>It is an observational study</u><u> because the researcher is </u><u>NOT</u><u> manipulating the explanatory variable</u>, whether a person drinks green tea or not, in order to study the effect of the value it takes, over the dependent variable: LDL cholesterol level.

<u>In opposition, experimental studies manipulate the explanatory variable</u> in order to assess the effects caused on the dependent variable by such deviance.

3 0
2 years ago
Other questions:
  • Egyptian trade extended up and down the Nile, including trading with Kush at the southern end of the river. Egypt also traded he
    6·2 answers
  • Read the sentence. Trayvon, Julie, and Caleb who are members of the drama club, are auditioning for the school musical on Wednes
    5·2 answers
  • 1. How has online or web-based banking changed how people choose and use
    9·1 answer
  • Which of the following households most likely has the greatest need for life insurance?
    12·1 answer
  • San Bernardino seller Craig Watkins has just signed a contract to sell his home of 13 years to buyer Ivedale Bosch, who has rece
    9·1 answer
  • Sally is a talkative three-year-old with a rapidly growing vocabulary. she describes to her mother how good her chicken nuggets
    7·1 answer
  • When Shauna looked at the legal description of the property she was interested in purchasing, she read the following: "Beginning
    15·1 answer
  • Which line from the passage suggests that Emerson believes that hardworking individuals succeed in a capitalist society? “Wealth
    14·2 answers
  • National Association of Social Workers, Council on Social Work Education, and the International Federation of Social Workers all
    8·1 answer
  • "nepali arts are related to religious and cultural practices" justify the statement.<br>​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!