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
gizmo_the_mogwai [7]
3 years ago
15

Debug the code in the main method of this class, which is intended to initialize an array named arr to hold 3 ints, fill this wi

th 3 inputs from the user, then print the contents of the array in order followed by the sum.
Here's the code that needs to be fixed:

import java.util.Scanner;

public class U6_L1_Activity_One{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int[] arr = new int(3);
arr[1] = scan.nextInt();
arr[2] = scan.nextInt();
arr[3] = scan.nextInt;
System.out.println("Contents: " + arr{1} + " " + arr{2} + " " + arr{3});
System.out.println("Sum: " + arr[1] + arr[2] + arr[3]);
}
}
Computers and Technology
1 answer:
pentagon [3]3 years ago
5 0

Answer:

import java.util.Scanner;

public class U6_L1_Activity_One{

 public static void main(String[] args){

   Scanner scan = new Scanner(System.in);

   int[] arr = new int[4];

   arr[1] = scan.nextInt();

   arr[2] = scan.nextInt();

   arr[3] = scan.nextInt();

   System.out.println("Contents: " + arr[1] + " " + arr[2] + " " + arr[3]);

   int Sum = (1 + 2 + 3);

   System.out.println("Sum: " + Sum);

 }

}

Explanation:

You might be interested in
What is an example of a one-to-many relationship?
jok3333 [9.3K]
Last option o si employee is
8 0
3 years ago
Read 2 more answers
Which are elements involved in diagramming a solution? Choose all that apply.
katovenus [111]

Answer:

1) showing a visual graphic of the solution

3) showing the flow of information through the solution

4) showing decision points

5) showing the path of information to decision points

Explanation:

 I'm sure this is the answer!!

4 0
3 years ago
To analyze data from a survey, you use a spreadsheet to calculate the percent of students who prefer corn over broccoli or carro
alisha [4.7K]

<u>Answer</u>:

<em>By changing the decimal to a percentage </em>

<u>Explanation:</u>

Since the requirement is to calculate the percentage of students about their preference in eating vegetables, we need to convert the given values to percentage only.  

<em> Option A: </em>By changing the addition sign to a multiplication sign. This is invalid because, there is no addition and multiplication involved in converting to percentage

<em>Option C:</em> By changing the percentage to a decimal. The given data is not available in percentage so conversion is impossible.

<em>Option D:</em> By changing the multiplication sign to a division sign Multiplication and division are not going to be performed here, since we need only percentage.

4 0
3 years ago
Read 2 more answers
Match the actions of individuals with the code of conduct they are adhering to. Sofia is an HR Manager who keeps all employee re
aksik [14]

All the code of conducts is good and it is expected from each and every employee of the organization. Employee details needs to be kept confidential and Sofia, the HR manager is adhering to it. Employee’s productivity increases if unnecessary use of mobile phone stops.

It is always recommended to use free items than the copyrighted items. It’s a good ethical practice. Becky is also right, because he considers work as work and does not get deviated with dinner invites and gifts.

5 0
3 years ago
Read 2 more answers
Juan has performed a search on his inbox and would like to ensure that the results only include those items with
lubasha [3.4K]

Answer:

The Refine command group

Explanation:

8 0
3 years ago
Other questions:
  • In JAVA, answer the following:
    15·1 answer
  • if your computer is frozen, what is something you would do to troubleshoot the problem? A. check if the monitor is plugged in B.
    15·2 answers
  • Widgets are ___________ a. objects b. icons c. functions d. components
    11·1 answer
  • What is the purpose of an internet protocol address (ip address)?
    5·1 answer
  • One factor affecting digital camera quality is the number of pixels, measured in ____, used to store the data for each image.
    8·2 answers
  • What are the advantages of Napier bones?​
    15·1 answer
  • The first thing you should select if you're using an Address Block or Greeting Line is
    11·1 answer
  • An ____ is a collection of tools, features, and interfaces that enables users to add, update, manage, access, and analyze the co
    10·1 answer
  • Which of the following statements represents a scientific bias?
    15·1 answer
  • Which of the following is a database concept that allows for storage and analysis for a dozen to billions of data points?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!