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
Wewaii [24]
4 years ago
13

What does the following fragment of code display? What do you think the programmer intended the code to do, and how would you fi

x it? int product = 1; int max = 20; for (int i = 0; i <= max; i++) product = product * i; System.out.println("The product is " + product);
Computers and Technology
1 answer:
postnew [5]4 years ago
8 0

Answer:

0

Explanation:

Given the code segment:

  1.        int product = 1;
  2.        int max = 20;
  3.        for (int i = 0; i <= max; i++)
  4.            product = product * i;
  5.        System.out.println("The product is " + product);

Since the counter i in the for loop started with 0, and therefore <em>product * i </em>will always be 0 no matter how many rounds of loop to go through.

The code is likely to perform factorial calculation. To do so, we need to change the starting value for the counter i to 1.

  1.        int product = 1;
  2.        int max = 20;
  3.        for (int i = 1; i <= max; i++)
  4.            product = product * i;
  5.        System.out.println("The product is " + product);

You might be interested in
A small bank with several regional branches is searching for a solution to consolidate its business services into a single site
Licemer1 [7]

Answer:

private cloud

Explanation:

Based on the scenario being described it can be said that the best method to meet the banks needs would be implementing a private cloud. This is an pool of shared computing resources in a public cloud, but one which is completely isolated from other organizations using the same provider or cloud resources. Which is exactly what the small bank needs in this situation.

4 0
3 years ago
Read 2 more answers
How is hardware different from sofware?
ExtremeBDS [4]

Answer:

Computer hardware is any physical device used in or with your machine, whereas software is a collection of code installed onto your computer's hard drive. For example, the computer monitor you are using to read this text and the mouse you are using to navigate this web page are computer hardware.

All software utilizes at least one hardware device to operate. For example, a video game, which is software, uses the computer processor (CPU), memory (RAM), hard drive, and video card to run. Word processing software uses the computer processor, memory, and hard drive to create and save documents.

6 0
3 years ago
Quick!! I'm TIMED!!!
agasfer [191]

Cloud suites are stored at a(n) option d. server on the Internet, rather than on your microcomputer.

<h3>What is a cloud at the Internet?</h3>

"The cloud" refers to servers which might be accessed over the Internet, and the software program and databases that run on the ones servers. Cloud servers are positioned in facts facilities all around the world.

A cloud suite is a cloud computing version that shops facts at the Internet via a cloud computing company who manages and operates facts garage as a service. It's brought on call for with just-in-time capability and costs, and gets rid of shopping for and handling your very own facts garage infrastructure.

Read more about the cloud suites :

brainly.com/question/5413035

#SPJ1

5 0
2 years ago
Can you guys help me with this coding assignments?
kicyunya [14]

Explanation:

x ==50

while x< 100;

x -= 1

8 0
3 years ago
Rockstar Software, Inc., develops a new series of performance-related video games. This software is most likely protected by
Nimfa-mama [501]
DRM likely is the answer. Anything that prevents duplication really.
6 0
4 years ago
Other questions:
  • What was a lesson that the Enlightenment taught people?
    11·1 answer
  • Select the correct statement about data preparation.
    10·1 answer
  • When hundreds, thousands, or even hundreds of thousands of zombie computers are gathered into a logical computer network under t
    6·2 answers
  • Explain The Two Way Communication in full.
    10·1 answer
  • How are desktop and mobile operating systems similar?
    5·1 answer
  • What is considered to be the core of the Unix operating system ?
    14·1 answer
  • Samira recently opened an online potted plant store and needs to promote it. She chose Google Ads because it offers advertisers
    12·2 answers
  • In python
    9·1 answer
  • Which of the following are good ways to keep your information and your computer secure?
    10·2 answers
  • assuming the default gateway is connected to the internet, what type of internet access would this server have?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!