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
Blababa [14]
3 years ago
14

8.6 Code Practice: Question 2

Computers and Technology
1 answer:
Julli [10]3 years ago
7 0

Answer:

In Java:

import java.util.*;

public class Main{

public static int sumArray(int []arr, int lent){

    int sum = 0;

    for(int i = 0; i<lent; i++){

     sum+=arr[i];

 }

 return sum; }

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 System.out.print("Number of elements: ");

 int lent = input.nextInt();

 Random rd = new Random();

 int [] intArray = new int[lent];

 for(int i = 0; i< lent; i++){

     intArray[i] = rd.nextInt(100)+1;

 }

 System.out.print("Total: "+sumArray(intArray,lent));

}

}

Explanation:

<em>No previous code was provided; So, I had to write the program from scratch (in Java)</em>

<em>Also, the elements of the array were generated randomly</em>

<em>See attachment for program source file where I used comments for explanatory purpose.</em>

Download txt
You might be interested in
I'm trying to connect fire stick but it doesn't have HDMI input so guys what would do you recommend to buy I tried a converter b
mihalych1998 [28]
I suggest you get a adapter from the old video input to HDMI
7 0
3 years ago
Name at least 3 different portable computer devices that can be purchased
rosijanka [135]

Answer:

Smart Phone

Cameras

Console Controller

Brainliest and please say if its right!!

3 0
3 years ago
Read 2 more answers
What is a characteristic of a wan hub-and-spoke topology?
olga nikolaevna [1]

The characteristic of the WAN hub and spoke topology is that it is considered to be a branch site or composed of the branch site in which they are likely to be connected to a site that is central and that is through the point to point links.

8 0
3 years ago
Marcus creates a HTML webpage on his favourite game, football. On clicking the word “football” another website containing the in
igomit [66]

please mark me as the brainlest answer please

if you do it then I will answer your all questions.

4 0
3 years ago
The ________ is responsible for the Internet's domain name system and the allocation of IP addresses. ICANN W3C ISOC IAB
Maurinko [17]

Answer:

ICANN

Explanation:

It handles the installation and processing of various databases related to network domains and provides a consistent and secure networking service and there are incorrect options are described as follows:

  • IAB, which provides a protocol for managing IETF, is therefore incorrect.
  • W3C is used in web development.
  • ISOC is used to provide Internet access.
7 0
4 years ago
Other questions:
  • What does the group on option do?
    10·1 answer
  • What xDSL version provides a maximum throughput of 24 Mbps downstream and 3.3 Mbps upstream?
    9·1 answer
  • What are options in the Advanced tab in the Share Workbook dialog box? Check all that apply.
    14·2 answers
  • What is the default font style of “Title” box in MS PowerPoint 2013?
    8·1 answer
  • Please help fast
    5·1 answer
  • 300134223+304532264440=
    11·2 answers
  • Pls answer i will give 20 points
    7·1 answer
  • What does altgr mean on a keyboard.
    10·1 answer
  • Which option should Gina click to edit the text contained in a text box on a slide in her presentation?
    10·1 answer
  • Class Main {
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!