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
marusya05 [52]
3 years ago
5

Write an if-else statement that displays 'Speed is normal' if the speed variable is within the range of 24 to 56. If the speed v

ariable’s value is outside this range, display 'Speed is abnormal'.
Computers and Technology
1 answer:
kari74 [83]3 years ago
4 0

Answer:

import java.util.Scanner;

public class Speed{

int speed;

public Speed(int speed){

this.speed = speed;

}

public void checkSpeed(){

if(speed >= 24 || speed <= 56){

System.out.println("Speed is normal");

}

else

System.out.println("Speed is abnormal");

}

public static void main(String...args){

Scanner input = new Scanner(System.in);

int userSpeed = 0;

System.out.println("Enter a speed: ");

userSpeed = input.nextInt();

Speed obj1 = new Speed(userSpeed)

obj1.checkSpeed();

}

Explanation:

You might be interested in
Producers must understand the marginal benefit of making an additional unit which shows the ...
yan [13]

Producers must understand the marginal benefit of making an additional unit which shows the possible gain. Marginal benefit is used in business and economics as a measurement of the change in benefits over the change in quantity. Possible gain is one example of benefit.  This measurement provides the relevant measurement of benefits at a specific level of production and consumption.

8 0
3 years ago
Read 2 more answers
What are the primary functions of motor oil? a. Reduce friction and prevent wear b. Keep engine surfaces clean c. Remove heat to
ryzh [129]

The answer is E: all of the above.

7 0
3 years ago
Insert a row above the selected row
anastassius [24]
I cants see the "Selected Road" And I cant answer this unless you put that up. Sorry.
6 0
3 years ago
Read 2 more answers
PLS HELP MEE!!!
kramer

Answer:

starting with lowercase letters, using uppercase letters for the first letter in a new word

Explanation:

starting with a dollar sign, using lowercase for the remaining parts of each word

4 0
2 years ago
Is it possible to build a portal in real life?
san4es73 [151]

No because we are not that  far in technology.

3 0
2 years ago
Read 2 more answers
Other questions:
  • The automotive system that connects the engine and the transmission to the wheels is called the
    14·1 answer
  • Given an object context for an Entity Data Model named mmaBooks, which of the following statements would you use to add a Custom
    15·1 answer
  • Object-oriented programs employ a group of techniques for handling errors called ________ handling.
    12·1 answer
  • If you want a user to enter exactly 20 values, which loop would be the best to use?
    9·1 answer
  • A recommended cleaner for the bowls of coffee brewers is
    7·1 answer
  • 2. ¿Cuáles de los siguientes Software son lenguajes de Programación?
    10·1 answer
  • PACIFIC NORTHWEST
    10·1 answer
  • Which is a monthly cost associated with renting a house?
    11·2 answers
  • If a person communicates indirectly and attaches little value to
    6·1 answer
  • JAVA -Develop a program that prompts the user to enter a series of 10 integers and then determines and displays the largest and
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!