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
Brainlist will be added!✴
Bess [88]

You can transfer this file by inserting your USB or Lightening Cable into the computer's USB Port, then you go into the Computer Window on the computer and find your device and then look for the file in it's specific folder!

5 0
3 years ago
In order to organize your work effectively on the computer, where is the best place to save it?
Morgarella [4.7K]
Your answer is -

B. Folder Is the best place to save it
8 0
3 years ago
Read 2 more answers
In programming, what is a string?
vovikov84 [41]

Answer:

B.

Explanation:

A. is not the correct answer because that is called a LAN cable (ethernet)

C. is not correct because it has nothing to do with text messages or printing

D. is called a Bus, and isn't the right answer either

3 0
3 years ago
Read 2 more answers
More registers appear to be a good thing, in terms of reducing the total number of memory accesses a program might require. Give
gulaghasi [49]

Answer:

Following is given the answer step by step:

Explanation:

First of all we will write a program using MARIE that will support the statement: Sum = (A + B) - (C + D). All the necessary comments are given in front of each statement:

Load    A                   # variable A will be loaded

Add     B                  # B will be added to A

Store   Temp1         # A + B will be stored in Temp1

Load    C                  # C will be loaded in memory

Add     D                 # D will be added to C

Store   Temp2         # C + D will ge stored in Temp2

Load    Temp1         # Temp1 will be loaded in the memory

Subt     Temp2         # Temp2(A + B) get subtracted from Temp1(A - B)

Store    Sum             # (A + B) - (C + D) will get stored in Sum.

We can see from above program that memory is accessed 9 times. While if C + D get executed first than memory accesses will be reduced to 7.

Above same program could be written using an architecture of 4 registers:

  • R1
  • R2
  • R3
  • R4

The program is as follows:

Load   R1 , A     #A  will be loaded into R1

Load   R2 , B    # B will be loaded into R2

Add     R1 , R2    # R2 gets added to R1 and the result is stored in R1 (A + B)

Load   R3 , C      # C loaded into R3

Load   R4 , D     # D loaded into R4

Add    R3 , R4   # Value in R4 gets added into R3 and R3 becomes (C + D)

                          #no memory accesses required for this operation

Subt   R1 , R4     #R4 (C + D) gets subtracted from R1 (A + B)

                         #no memory accesses required for this operation

Store  Sum        # The recent value will be stored into Sum

Here memory is accessed 5 times in total.

<h2>I hope it will help you!</h2>
8 0
3 years ago
Electronically, or on paper draw a Binary Search Tree using the values below. Note: Insert each value into the tree in order fro
maria [59]

Answer:

A.)  in order traversal - 9 32 35 14 27 25 2 7 29

B.) pre-order traversal - 25 14 32 9 35 27 7 2 29

C.) post-order traversal - 9 35 32 27 14 2 29 25

Explanation:

Given - 25, 14, 7, 32, 27, 2, 29,9,35

To find - On a separate electronic page or sheet of paper:

1. List the values using in order traversal

2. List the values using pre-order traversal

3. List the values using post-order traversal

Proof -

Given values are -

25, 14, 7, 32, 27, 2, 29,9,35

1.)

In order is -

9 32 35 14 27 25 2 7 29

2.)

Pre-order is - (Root left right)

List nodes of first time visit

25 14 32 9 35 27 7 2 29

3.)

Post-order is - (Left Right Root)

List nodes of third time visit

9 35 32 27 14 2 29 25

5 0
3 years ago
Other questions:
  • Lance has three tables in his database he wants to generate a report to show the data from the three table so he decides to link
    6·2 answers
  • In ssl/tls, a specific set of protocols that a particular cryptographic system will use to provide protection is called a ______
    5·1 answer
  • Within the Chart Design tab, which section is used to change the data of a previously created chart?
    12·1 answer
  • Define additional characteristics such as font weight or style for an html tag
    5·1 answer
  • I keep getting this error: postfix.cpp: In function ‘double RPN_evaluation(std::string)’: postfix.cpp:42:26: error: cannot conve
    7·1 answer
  • How many times would the following loop iterate?
    15·1 answer
  • Charlie does not think he will be able to finish his project by the deadline at this point in the decision making progress to so
    13·1 answer
  • In your own words explain how to add footer and head in a word doc.
    10·1 answer
  • What does the following code print?
    15·1 answer
  • The…..executed simple
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!