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
.- Una tienda de vestidos de fiesta, ofrece un descuento a las personas
elena55 [62]

ajaaaieisslslqlqlqqpqlkek3k2l2ll2llllww

4 0
3 years ago
Which type of element is , and what is the meaning of that element?
IrinaK [193]

Answer:

1. Semantic

2. modifies

Explanation:

Semantic HTML is understood by the traditional browser, and semantic tags are the one that ensures not just presentation, but also adds the meaning to the webpage. And hence, img here is both semantic as well as presentational. Hence, the first option is semantic. And the IMG modifies the meaning of the web page. The description is done by the text. And hence the second option is modified.

.

6 0
3 years ago
I need a C++ program to ask the user to put in different numbers until zero is pressed then the program counts the numbers that
frozen [14]

Answer:

#include <iostream>

using namespace std;

int main()

{

int input = 0;

int count = 0;

int sum = 0;

int sumNegative = 0;

while (true) {

 cout << "Enter a number: ";

 cin >> input;

 if (input == 0) break;

 count++;

 sum += input;

 if (input < 0) {

  sumNegative += input;

 }

}

cout << "Count of the numbers: " << count << endl;

cout << "Sum of all the numbers: " << sum << endl;

cout << "Sum of the negative numbers: " << sumNegative << endl;

}

Explanation:

Your requirements regarding the sum and the negative numbers was a bit vague so I just did something you can probably adjust easily to your liking.

7 0
3 years ago
What is the purpose of installing updates on your computer?
Lostsunrise [7]

The purpose of adding updates to your computer are as follows:

  • Making sure your computer hardware can run the newest software programs
  • Ensuring the built-in virus protection software is up to date
  • Removing bugs and glitches from your operating system
  • Allowing your computer to run as fast as possible
4 0
2 years ago
Why Embedded operating systems are also known as real-time operating systems (RTOS)?
kati45 [8]

Answer:

A real-time operating system is an operating system designed to support real-time applications that, usually without buffer delays, process data as it comes in. A real-time system is a time-bound system that has fixed, well defined time constraints.

6 0
3 years ago
Other questions:
  • 1. What are the biggest risks when using the public Internet as a Wide Area Network (WAN) or transport for remote access to your
    6·1 answer
  • If I put a short clip from a copyrighted video to Facebook and make it only viewable to friends, is that illegal?
    12·1 answer
  • Describe the following software process models using your own words .Your explanation should also provide an example of a softwa
    12·1 answer
  • Which of the following STEM discoverers developed a new type of computer hardware?
    11·1 answer
  • You can tell that the equals() method takes a ____ argument because parentheses are used in the method call.
    6·1 answer
  • Which osi/iso layer is responsible for determining the best route for data to be transferred?
    5·1 answer
  • What is a system unit
    7·1 answer
  • BEING TIMED HELP ASAP
    12·2 answers
  • Write a method so that the main() code below can be replaced by simpler code that calls method calcMilesTraveled(). Original mai
    11·1 answer
  • Which of the following is a key difference between a Windows 7 restore point and one you set yourself?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!