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
aleksley [76]
3 years ago
6

The following code is intended to test whether the int variable num is less than 10, and if so print a warning and set it to 10.

The code then prints the value of num.
if (num < 10)
System.out.println( "This is smaller than 10" );
num = 10;
System.out.println("Value of num is " + num);
What correction should be made so the code functions as intended?

An else statement should be added between the 3rd and 4th lines
The final line should be printed every time, not just when num hasn’t been changed.
A semicolon should be added at the end of the first line
The operator ‘<’ should be changed to ‘<=’ in the if statement
No correction should be made
Curly braces ‘{ }‘ should be added to enclose the second and third lines

Computers and Technology
1 answer:
hoa [83]3 years ago
6 0

The only correction I see is you need to add curly braces to enclose the second and third lines.

You might be interested in
You are planning trip to South America and and are worried about your devices with private keys being stolen. So you decide to s
scZoUnD [109]

Incomplete question. Here's the remaining part of the question.

a. <sig> <pubKey>

b. <password>

c. <sig> <password>

d. <pubKey> <password>

Answer:

<u>a</u>

Explanation:

Remember, Bitcoin also has its script code which is called ScriptPubkey.

To redeem a transaction implies using the script

<sig> <pubKey>

for the receiving Bitcoin address.

Put simply, the purpose of this script is to lock (redeem) the transaction using the public key (bitcoin address).

7 0
4 years ago
Why do we need to measure the amperage of an electric current?​
Sonbull [250]

Answer:

Explanation:It is very important to have a way to measure and quantity the flow of electrical current. When current flow is controlled

It can be used to do useful work. The flow of current is measured in pampered. The term amps is often used for short.

5 0
3 years ago
Emily has to create an audio-visual presentation on animated movies. Which input device will she be LEAST likely to use while cr
Slav-nsk [51]
A joystick is less likely to be used while creating this presentation. Obviously, If your intention is to create an audio-visual presentation on animated movies, a computer should be used. With a computer, comes a keyboard, a mouse and a microphone as well.

A Joystick is used to control video games and play simulator games. Therefore, I do not see the need of using a joystick in this situation.

6 0
3 years ago
Which display technology was developed by apple, produces vibrant colors, and supports viewing from all angles?
Vedmedyk [2.9K]
4.5K Retina display I think that is the answer you’re looking for
3 0
2 years ago
Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of userItem. Print "Unknown" (followe
vagabundo [1.1K]

Answer:

I am writing a C++ program. Let me know if you want the program in some other programming language. Here is the portion of the code:

if((userItem == GR_APPLES) || (userItem == GR_BANANAS)){

 cout << "Fruit";   }

else if((userItem == GR_JUICE) || (userItem == GR_WATER)){

 cout << "Drink";  }

else{

 cout << "Unknown";  }  

cout << endl;

 

Explanation:

The IF statement is used to check the defined options with the value in the userItem.

If the value of the userItem is GR_APPLES OR GR_BANANAS then Fruit is printed as the output. || represents a logical operator OR so this means that userItem can be either the GR_APPLES or GR_BANANAS for the If condition to evaluate to true.

If the above condition evaluates to false then the else-if part will be checked next. So the else if checks if the value in the userItem is GR_JUICE or GR_WATER. If userItem contains either of these two then Drink is displayed on the screen as output.

If the else-if statement also evaluates to false then the else part is executed which displays Unknown.

The cout<< endl; statement in the last is used to print the new line. For example if the output is Unknown then it is followed by a new line.

In the given program userItem is set to GR_APPLES

GroceryItem userItem = GR_APPLES

So the output of the whole program is Fruit followed by a new line.

The screenshot of the code along with the output is attached.

7 0
4 years ago
Other questions:
  • Which of the following represent features of
    6·1 answer
  • Write a program that reads in two integers typed on the keyboard and outputs their sum, difference, and product.
    12·1 answer
  • What advantages do fiber optic cables offer over twisted pair or other media choices?
    8·1 answer
  • How do you guys feel about the coronavirus and being Homeschooled
    10·1 answer
  • Is it important for a writer to include voice and point of view in writing because... Plz help
    15·1 answer
  • To generate a report with exact results based on specific criteria it is best to base the report on a(n) ____________________ cr
    6·1 answer
  • _____________ helps to control and limit the number of consecutive request failures that cross a threshold. Review breaker Micro
    7·1 answer
  • URGENT!!!
    9·1 answer
  • Which of the following is not an example of a cyber crime?
    8·1 answer
  • 16. Your character qualities never change. (3 points)<br> A. True<br> B. False
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!