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
If given the chance to own manage a business,what will be the name of the business?
Nady [450]
This is honestly an answer you can give. What would you name a business if you made one?
7 0
3 years ago
Read 2 more answers
The purpose of maintaining a network of digital forensics specialists is to develop a list of colleagues who specialize in areas
Rudiy27

Answer:

True

Explanation:

Computer security is basically divided into three main areas:

  1. Vulnerability/threat assessment and risk management refers to a process that requires the identification, quantification and ranking of a system's possible vulnerabilities.
  2. network intrusion detection and incident response refers to software that detects malicious activity or policy violations, and blocks them
  3. digital forensic investigation refers to the process of identifying, recovering and interpreting (or validating) electronic data.

Generally a single individual may specialize in one of these areas, that is why he/she may need help with the others.

8 0
3 years ago
Read 2 more answers
Which of the following best describes the difference between the domain and path of a URL?
Lana71 [14]

Answer:

the first choice

Explanation:

8 0
2 years ago
You want to substitute one word with another throughout your
Hitman42 [59]
I’m pretty sure it’s “Find and paste”
8 0
3 years ago
What is another word for microchips operating systems input methods and everything in between?
lord [1]
The answer is computer. A computer is made up of microchips (CPU and GPU), an operation system (macOS or Windows), input methods (keyboard and mouse), and other parts.
7 0
3 years ago
Other questions:
  • Philip is thinking about customizing his motorcycle. A paint job, saddlebags, and a radio would cost $600. His motorcycle is old
    15·2 answers
  • Which computer network component allows data transfers from one computer to another through a telephone line?
    11·2 answers
  • This is a wise and hard question.....What is the hardest question in the world? I know the answer do you?
    10·1 answer
  • You are running an art museum. There is a long hallway with k paintings on the wall. The locations of the paintings are l1, ...,
    13·1 answer
  • Solve the recurrence relation.<br> S(1)=1<br> S(n)= S(n-1)+(2n-1) for n&gt;=2
    13·1 answer
  • How is counting in this circle and square system similar to how we count in our regular lives? How is it different?
    15·1 answer
  • Overlay analysis is ____________, taking in data from two or more layers to create a single output layer.
    5·1 answer
  • If you would like to give another user permissions on your mailbox or to particular folders within your mailbox, which role shou
    13·2 answers
  • What is the 3 different storage requirements a computer has to process data​
    12·1 answer
  • (1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!