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
USPshnik [31]
3 years ago
14

Write code that prints: userNum ... 2 1 Print a newline after each number. Ex: userNum

Computers and Technology
1 answer:
ehidna [41]3 years ago
4 0

Answer:

The program to this question can be given as follows:

Program:

public class data //defining class data

{

//main method

public static void main (String [] as) //declaring main method  

{

int userNum = 4; //declare variable userNum and assign value

for (userNum = 1; userNum <= 4; userNum++)  //loop for print values

{

System.out.println(userNum);  //print values in new lines.

}

}

}

Output:

1

2

3

4

Explanation:

In the above java program code firstly a class "data" is defined, inside this class the main method is defined in which an integer variable userNum is defined that holds a value that is "4".

  • In this method, a for loop is declare that uses variable userNum which starts from 1 and ends with a given value that is equal to 4.
  • Inside a for loop, the print function is used that print userNum variable each values in the newline.  

You might be interested in
An alternative to configuring individual workstations is to establish configurations dynamically when the computers connect to t
Lapatulllka [165]

Answer:

come help me on my last question please

Explanation:

6 0
3 years ago
Which of the following code displays the area of a circle if the radius is positive. a. if (radius != 0) System.out.println(radi
maw [93]

Answer:

d. if (radius > 0) System.out.println(radius * radius * 3.14159);

Explanation:

The positive values are those values that are greater than 0(zero).0 is considered to be nonnegative number it is neither positive nor negative and for a zero radius the area will be 0.As we know the are of the circle is π*radius*radius, and π is 3.14159.So the correct answer matching to this condition is option d.

Which checks if the radius is greater than 0 then find the radius and print it.

8 0
3 years ago
Which of these is NOT one of the main parts of an email?
slega [8]
I think the answer is c
3 0
3 years ago
Read 2 more answers
Write a program that reads in a temperature value in °F. Create a function ConvertFahrenheit that takes that value as a paramete
larisa86 [58]

Answer:

#include<stdio.h>

void ConvertFahrenheit(float);

void main()

{

float fahrenheit_temp;

printf("Input the temperature in Fahrenheit: ");

 

scanf("%f", &fahrenheit_temp);

 

ConvertFahrenheit(fahrenheit_temp);

}

void ConvertFahrenheit(float fahren) {

float c, k;

 

c = (fahren - 32)/1.8;

k = (fahren + 459.67)/1.8;    

 

printf("Celsius = %f\n", c);

printf("Kelvin = %f", k);

}

Explanation:

  • Inside the main function, take the temperature in Fahrenheit as an input from user and call the ConvertFahrenheit function by passing it the  fahrenheit_temp variable as an argument.
  • Create the ConvertFahrenheit function for the conversion  and convert the fahrenheit value to the Celsius and Kelvin by using their conversion formulas respectively.
  • Lastly, display the result in Celsius and Kelvin.
8 0
3 years ago
3 features of digital computer​
jolli1 [7]

Answer:

A typical digital computer system has four basic functional elements: (1) input-output equipment, (2) main memory, (3) control unit, and (4) arithmetic-logic unit. Any of a number of devices is used to enter data and program instructions into a computer and to gain access to the results of the processing operation.

Explanation:

6 0
2 years ago
Other questions:
  • Speech on inventors and inventions
    14·1 answer
  • Why should spain go to Africa ​
    15·1 answer
  • on average, someone with a bachelor’s degree is estimated to earn _______ times more than someone with a high school diploma
    13·1 answer
  • A beginning driver may tend to oversteer. This means the driver what? Btw Cars are technology so that is why it is under Compute
    11·1 answer
  • Black Ops 3 For Ps4 Players Here
    7·1 answer
  • Lydia noticed that she feels tired and out of breath after walking her dog up a hill in the park. Which area of fitness does she
    8·1 answer
  • In which of the following situations will a macro make your work more efficient?
    9·1 answer
  • Output each floating-point value with two digits after the decimal point, which can be achieved by executing cout &lt;&lt; fixed
    7·1 answer
  • What stipulates that the source code of any software published under its license must be freely available.
    14·1 answer
  • You have been trying all day to check your direct messages on social media. The site is really slow to load and sometimes you ca
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!