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
What is the purpose of a title slide on power point
ArbitrLikvidat [17]
It would be D because whenever there is a title slide, you get an idea of what you are talking about

8 0
4 years ago
Read 2 more answers
What happens if i receive a text while my phone is off?
SIZIF [17.4K]
The text will post to your phone when it gets turned on
4 0
4 years ago
You began a small mobile app company. To help market your apps, you create a social media site. The site allows users to join co
dem82 [27]

Answer: shared

Explanation:

Shared media simply refers to the contents that a particular brand posts to social media platforms.

In such cases, the site gives room for the users to join conversations regarding the post being shared by the brand. It is typically cost effective and used by several organizations.

3 0
3 years ago
The process of arranging the item of a column in some sequence or order is known as?
MatroZZZ [7]

answer: sorting??  

(hope it helps)

6 0
2 years ago
Computing devices translate digital to analog information in order to process the information
tester [92]

Complete Question:

Which of the following about computers is NOT true?

Group of answer choices.

A. Computing devices translate digital to analog information in order to process the information.

B. Computing devices are electronic.

C. The CPU processes commands.

D. The memory uses binary numbers

Answer:

A. Computing devices translate digital to analog information in order to process the information.

Explanation:

Computing is the process of using computer hardware and software to manage, process and transmit data in order to complete a goal-oriented task.

The true statements about computers are;

I. Computing devices are electronic: the components and parts which makes up a computer system are mainly powered by a power supply unit and motherboard that typically comprises of electronic components such as capacitors, resistors, diodes etc.

II. The CPU processes commands: the central processing unit (CPU) is responsible for converting or transforming the data from an input device into a usable format and sent to the output device.

III. The memory uses binary numbers: computer only understand ones and zeros.

5 0
3 years ago
Other questions:
  • You should hand write your references on your resume.
    15·2 answers
  • ____ devices are high-performance storage systems that are connected individually to a network to provide storage for the comput
    12·1 answer
  • The frequencies licensed by telecommunication firms to provide wireless service is known as _____.
    13·1 answer
  • Zach would like to reuse a spreadsheet that he created last year. However, he will need to delete the contents of several cells.
    5·1 answer
  • CMS is a content management system that collects, organization, publishes, and manages creative content. Right...?
    9·1 answer
  • Using the Impress program, you can add multimedia files, including audio, image, and video files, to the presentation
    13·2 answers
  • Write a program that declares three one-dimensional arraysnamed miles, gallons, and mpg. Each array should be declared in main()
    10·1 answer
  • After reading his e-mail messages, Orlando became very frustrated. Many of the messages he received did not conform to netiquett
    6·1 answer
  • A laptop can be kept on palm to work. [true/false) ​
    5·1 answer
  • 70 point Brainlist to best answer
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!