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
Two files named numbers1.txt and numbers2.txt both have an unknown number of lines, each line consisting of a single positive in
Reika [66]

Answer:

see explaination for program code

Explanation:

scalar_product = 0

li=[]

li2=[]

#reading numbers1.txt and numbers2.txt intoli and li2 respectively

with open('numbers1.txt') as n1, open('numbers2.txt') as n2:

for line1 in n1:

li.append(int(line1))

for line2 in n2:

li2.append(int(line2))

#storing min list size into variable l

a=len(li)

b=len(li2)

if a<b:

l=a

else:

l=b

#calculating scalar product

for i in range(l):

scalar_product=scalar_product+li[i]*li2[i]

print("scalar product is",scalar_product)

6 0
3 years ago
How do u friend people
Verdich [7]
You click on the three dots and click the person silhouette with the plus sign on it.
4 0
3 years ago
Read 2 more answers
A ____ firewall keeps a record of the state of a connection between an internal computer and an external device and then makes d
Yakvenalex [24]

Answer:

Stateful frame filtering

Explanation:

<h2><u>Fill in the blanks</u></h2>

A <u>Stateful frame filtering </u> keeps a record of the state of a connection between an internal computer and an external device and then makes decisions based on the connection as well as the conditions.

8 0
3 years ago
To most efficiently distribute IP address pools in networks, system administrators typically set up services that automatically
zhuklara [117]

Answer:

Explanation:

Dynamic host configuration protocol DHCP help us to assign an IP automatically, with this method is not necessary to get more IP blocks because this method use lease time or rental IP, this means, if an IP is not being used, this is save for the next user, in this case, we're reciclyn the IP bloks, and this is the most efficient way to administrate our IP address.

8 0
3 years ago
What type of network sends signals through airwaves and usually does not require cables?
Ira Lisetskai [31]

Wireless Networks sends signals via airwaves and usually does not need cables.

<h3>What is Wireless Networks?</h3>

A wireless network exists as a computer network that utilizes wireless data connections between network nodes. Wireless networking is a process by which homes, telecommunications networks, and business installations. A wireless network guides a computer network that creates use of Radio Frequency (RF) connections between nodes in the network. Wireless networks exist as a popular solution for homes, businesses, and telecommunications networks.

Wireless networks operate utilizing Radio Frequency (RF) technology, a frequency associated with radio wave propagation within the electromagnetic spectrum. An electromagnetic field exists generated when an RF current is supplied to an antenna that can then spread through space.

There exist three different kinds of wireless networks – WAN, LAN, and PAN: Wireless Wide Area Networks (WWAN): WWANs are created via the use of mobile phone signals typically provided and sustained by specific mobile phone (cellular) service providers.

Hence, Wireless Networks sends signals via airwaves and usually does not need cables.

To learn more about Wireless Networks refer to:

brainly.com/question/26956118

#SPJ4

7 0
1 year ago
Other questions:
  • To insert a clip art you must do the following
    14·1 answer
  • The computers connected to the main server are called ______.
    14·2 answers
  • How much time per day does the average U.S. youth spend watching television, playing video games, or using a computer?
    8·1 answer
  • Assume an ArrayList and a Linked List each contain 10,000 items. Which operation is performed fastest
    14·1 answer
  • Question 7 (True/False Worth 3 points)
    8·2 answers
  • Remember that kid who would always ask you for your food, even though he packed his own lunch.
    8·2 answers
  • Write a list comprehension that creates a list containing the numbers that result from the values 1 through 10 being multiplied
    15·1 answer
  • Really helpful, I want to get together tomorrow ,Later I will follow and make it the best answer
    7·1 answer
  • A bulb has a resistance of 15Ω and is rated at 3A. What is the maximum voltage that can be applied across the bulb?
    7·1 answer
  • The process of arranging the item of a column in some sequence or order is known as?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!