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
Alex787 [66]
3 years ago
10

Consider the following two code segments. In both, assume that n is an integer variable that has been declared and initialized.

Segment 1 int prod = 1; int i; for (i = 2; i <= n; i++) { prod *= i; } System.out.println(prod); Segment 2 int prod = 1; int i = 2; while (i <= n) { prod *= i; i++; } System.out.println(prod); For which integer values of n do these code segments print the same result?
Computers and Technology
1 answer:
Ksivusya [100]3 years ago
6 0

Answer:

For every value of n.

Explanation:

In code segment 1 it uses for loop to store the product of integers from 2 to n in variable product it does that by using a for loop after that printing the product.

In the other code segment the same thing is done the only difference is that it uses a while loop instead of for loop to find the product and then printing the product.

So the result will be same for every value of n.

You might be interested in
Which statement is LEAST accurate? Select one: a. A common reason for ERP failure is that the ERP does not support one or more i
Fittoniya [83]

Answer:

d. To take full advantage of the ERP process, re-engineering will need to occur.

Explanation:

Justification:  

ERP Implementation: ERP gives a change in technological ways for managing resources, the way to run the business is remained same but now Ft becomes well planned Diversified P units of Mich do not share common process. and data, generally employ phased-in approach of implementing ERP

• It is the way to overcome from the risk which is with the big bang approach, direct switching

• Perfect implementation of ERP needs re-engineering on the basis of performance

a. maintenance Sometimes ERP which is installed could not support one of the business process. due to lack of research before selecting it

• The statement that the diversified organizations. not. implement ERPs is least accurate because they implement it by employing phased-in approach Therefore, the correct option is d

3 0
4 years ago
You have recently completed IPAM installation and configuration. You have several each of DHCPservers, DNS servers, and domain c
Lina20 [59]

Answer:

The option(4) is the correct answer to the given question .

Explanation:

The main objective of the IPAM server is providing the Stand-alone deployment and incorporated the Orion Framework also the IPAM server manages the ipv4 and ipv6 domains of the servers .

If their is no DHCP servers are being seen in the inventory of IPAM server we have the uninstalling the DHCP server in the IPAM server because After uninstalling the files the removed and correct files are  restored in the IPAM server .

Others Options are incorrect because they are objective of IPAM server Others Options do not solved the problem of view Inventory .So option(4) is the correct way to solve the problem .

4 0
4 years ago
Rules that govern how to communicate online are known as etiquette. netiquette. Internet laws. computer rights.
azamat

Answer:

Explanation:

i think it might be netiquette

7 0
3 years ago
Read 2 more answers
To adjust the height of cells, position the pointer over one of the dividing lines between cells. When the pointer changes to th
Sergio [31]

Answer:

double arrow shape

Explanation:

To adjust the height of the cells

1. We have to position the mouse pointer over one of the column line or the one of the row line.

2. As we place the pointer between the dividing lines, the cursor of the mouse pointer change from singe bold arrow to double arrow symbol.

3.Now press or click the left mouse button and drag the dividing lines of the   cells to the desired position to have the required width or height of the cell.

5 0
4 years ago
python Write a class named Taxicab that has three **private** data members: one that holds the current x-coordinate, one that ho
Blizzard [7]

Answer:

see explaination

Explanation:

class Taxicab():

def __init__(self, x, y):

self.x_coordinate = x

self.y_coordinate = y

self.odometer = 0

def get_x_coord(self):

return self.x_coordinate

def get_y_coord(self):

return self.y_coordinate

def get_odometer(self):

return self.odometer

def move_x(self, distance):

self.x_coordinate += distance

# add the absolute distance to odometer

self.odometer += abs(distance)

def move_y(self, distance):

self.y_coordinate += distance

# add the absolute distance to odometer

self.odometer += abs(distance)

cab = Taxicab(5,-8)

cab.move_x(3)

cab.move_y(-4)

cab.move_x(-1)

print(cab.odometer) # will print 8 3+4+1 = 8

5 0
4 years ago
Other questions:
  • "re-type the celsius_to_kelvin function. Change the name to kelvin_to_celsius, and modify the function accordingly."
    7·2 answers
  • Do all accounts use the same routing number
    12·1 answer
  • “When using a public computer for browsing the Internet, try to use for 1.________ transactions. Also, use 2.__________ browsing
    10·2 answers
  • A (n) _____________ chart is represented by a circle divided into portions.
    8·1 answer
  • g The state of Massachusetts at one time had considered generating electric power by harvesting energy crops and burning them. A
    15·1 answer
  • 3. Compilers and Assemblers translate each source file individually to generate object code files. Hence the object files need t
    13·1 answer
  • Marly is using her smartphone to review a webpage she created. The formatting and alignment of webpage elements is incorrect. Wh
    7·1 answer
  • When creating a storyboard, in which section do you mention how you move from one shot to the next?
    8·1 answer
  • WILL GIVE A BRAINLIEST!!! PLS HELP!!!
    5·1 answer
  • One of the difficult things about working in game design is that while there are many different roles, most of them only match o
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!