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
What component has the job of managing data as it flows into and out of the places it needs to go?
kompoz [17]
Memory controller. ......
3 0
3 years ago
Read 2 more answers
What does the merge &amp; center button in the alignment group on the home tab do?
e-lub [12.9K]
A merge and center does this;
if you have created a table,it just centers a sentance
6 0
3 years ago
Assign testResult with 1 if either geneticMarkerA is 1 or geneticMarkerB is 1. If geneticMarkerA and geneticMarkerB are both 1,
OverLord2011 [107]

Answer:

Following python statement will give the assignment to testResult as specified:

if((geneticMarkerA == 1) or (geneticMarkerB ==1)):

   testResult = 1

if((geneticMarkerA ==1) and (geneticMarkerB == 1)):

   testResult = 0

if((geneticMarkerA == 0) and (geneticMarkerB == 0)):

   testResult = 0

Explanation:

In above statements or and and operator are used to check the conditions of set of values present in variable geneticMarkerA and geneticMarkerB.

Based on if the condition evaluate to true or false respective values to testResult varaible is assigned.

Following is sample run for above statements:

geneticMarkerA = 1

geneticMarkerB = 0

if((geneticMarkerA == 1) or (geneticMarkerB ==1)):

   testResult = 1

if((geneticMarkerA ==1) and (geneticMarkerB == 1)):

   testResult = 0

if((geneticMarkerA == 0) and (geneticMarkerB == 0)):

   testResult = 0

print(testResult)

Output

1

4 0
3 years ago
PLZ ANSWER ALL MY QUESTION. Which line of code will display the variable num rounded to the nearest tenth?
zavuch27 [327]

Answer:

A

Explanation:

5 0
3 years ago
Which layer enables the receving node to send an acknowledgement?
Svetllana [295]

Answer:

Data link layer enables the receiving node to send an acknowledgement.

Explanation:

The data link has following function;

1 it send the acknowledgement to the node because for the reliable    transmission.

2.Data link layer provides the interface to the network layer.

3.it regulate  the flow of data.

4.It control the transmission error.

The important function of data link layer it created packets of the data to send the packets in guarantee manner for giving the acknowledgement to the node that data is received successfully.

6 0
3 years ago
Other questions:
  • A web page that integrates content and scripts from multiple web sites to create new applications is known as a:
    13·1 answer
  • Host A and B are directly connected with a 100 Mbps link. There is one TCP connection between the two hosts, and Host A is sendi
    14·1 answer
  • Write a function getPigLatin(pigStr) that accepts pigStr as a parameter (a sentence as input) and converts each word to "Pig Lat
    8·1 answer
  • Investments in data networks, ip addresses, routers, and switches are ________ because of their impact on productivity, security
    14·1 answer
  • Suppose you're currently completing an examination online. When you're finished, you click on Reset Exam. Why would you do this?
    8·1 answer
  • Which type of fiber-optic connector, containing one fiber-optic strand per connector, is connected by pushing the connector into
    7·1 answer
  • Generally speaking, problems are rarely caused by motherboards. However, there are some instances in which a motherboard can fai
    12·1 answer
  • High level languages are closer to machine language than humans yes or no​
    12·2 answers
  • Create a method called letterGrade that will pass the student's average grade as a parameter and return a letter grade (char). O
    12·1 answer
  • What does the 7 C s stand in communication skill​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!