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
Identify the four aspects of being sensitive to audience needs when writing business messages.
MA_775_DIABLO [31]
The four aspects are consists of : one should be sensitive towards the audience’s needs, adapting “you” attitude, Maintaining standards of Etiquette – emphasizing the positive to avoid negative language and be honest not harsh; should be respectful, tactful and talk with diplomacy, Using Bias-Free Language, building a strong relationship with the audience by establishing credibility.
6 0
1 year ago
What are some of the ethical issues that our society considers in regard to teenage pregnancy?
Ira Lisetskai [31]

I believe the answer is: single parenthood and abortion

Single parents would most likely create a massive hindrance in the teenage's future since their time would be divided between pursuing their economic needs and taking care of the kid. Abortion raises an ethical issues among people who see lives started as soon as the fetus is formed.

6 0
1 year ago
Psychoactive drugs capable of altering perception, mood, cognition, or behavior include
aev [14]
Psychoactive drugs capable of altering perception, mood, cognition, or behavior include "stimulants and depressants. opiates and psychedelics. <span>stimulants and psychedelics."



 
Stimulants refers to the drugs that accelerate action in the central nervous system, psychadelic drugs cognizance modifying drugs that deliver fantasies, change perspectives, or disturb the typical view of time and space. Depressants are the drugs that back off movement in the CNS and opiates are the drugs got from the opium poppy, that calm torment and generally create elation.</span>
4 0
2 years ago
Zia has taken seven courses at Harvard, and so far she has a grade average of C. All the courses she has taken have been in phil
julia-pushkina [17]

Answer:

Stronger

Explanation:

The statistical syllogism is also called a non-deductive syllogism. This process argues in using the inductive reasoning for generalization. It is true for a particular case.

This procedure used the syllogism like most, frequently and never and rarely. It has its statistical generalizations it has one or two premises.

Premises is a generalization and argument that is used to conclude the generalization. Premises can be true and the conclusion can be wrong but it happened rarely.

Thus Zia has used here statistical syllogism for different subjects.

3 0
2 years ago
Using complete sentences compare and contrast prehistoric law and current laws today.
Olegator [25]
There are so little evidences of what lives were during the prehistoric era. Most of our sources come from the biological and archaeological evidences gathered by different people. However, it is quite clear that the lives of people before were entirely depending on thinking that good is rewarded by a heavenly entity. This is very different from the laws today because of our aim to be more logical in decision making, etc. 
4 0
1 year ago
Other questions:
  • 5. What types of health conditions are considered serious and, therefore, warrant medical care in a prison setting? Name three
    6·2 answers
  • Chris argyris’ beliefs, as presented in his book personality and organization,are in disagreement with __________.
    13·1 answer
  • __________ can involve false beliefs that often involve the individual being harassed or manipulated by others.
    6·2 answers
  • The lesson of the battle of two wolves is:
    15·2 answers
  • Write a hypothesis for Section 1 of the lab, which is about the effect the type of material has on the absorption of sunlight on
    6·2 answers
  • Using the word “CAPITALISM,” create an acrostic poem that demonstrates your understanding of the term.
    6·2 answers
  • When you visit a former co-worker who recently retired, you are astonished at his list of activities and projects, and he says,
    9·1 answer
  • Which of the following is NOT included in measuring organizational performance? Group of answer choices Examining progress being
    15·1 answer
  • Remus is an art student who wants to start creating digital artwork on his computer. He wants to be able to create images that r
    14·1 answer
  • Maddie has an intense interest in food but eats sparingly and with disgust. She has an intense fear of becoming obese, and even
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!