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
Alchen [17]
3 years ago
5

9.6 Code Practice: Question 2

Computers and Technology
1 answer:
posledela3 years ago
5 0

A method named "sumArray" to your last program that takes an array as a parameter and returns the sum of its values.

Explanation:

The program is used to add a list of arrays.

import java.util.Scanner;

public class MethodsArrays {

   public static int[] fillArray() {

       Scanner scan = new Scanner(System.in);

       int size = scan.nextInt();

       int array[] = new int[size];

       int pos=0;

       for(int i=0; i<array.length; i++) {

           pos=i+1;

           System.out.println("Enter element " + pos);

           array[i]=scan.nextInt();

       }

       return array;

   }

   public static int sumArray(int [] array) {

       int sum=0;

       for(int i=0; i<array.length-1; i++) {

           sum=array[i]+array[i+1];

       }

       return sum;

   }

   }

   public static void printArray(int [] array) {

       for(int i=0; i<array.length; i++) {

           System.out.print(array[i] + " ");

       }

   }

   public static void main(String[] args) {

       fillArray();

       System.out.println("Sum=" + sumArray(array));

       printArray(array);

   }

}

You might be interested in
Which of the following recommendations should you follow when placing access points to provide wireless access for users within
Colt1911 [192]

A WLAN, or wireless local area network, is created by an access point, typically in an office or big building. An access point transmits a Wi-Fi signal to a predetermined region after connecting via an Ethernet cable to a wired router, switch, or hub. Thus, option C is correct.

<h3>What access points to provide wireless access for users?</h3>

You may determine your wireless access point IP address by going to the settings menu of your adapter if you're already connected to the network via Wi-Fi or Ethernet.

Therefore, Open Network & Internet settings can be accessed by selecting with the right mouse click on the network icon in the system tray.

Learn more about wireless access here:

brainly.com/question/13073711

#SPJ1

6 0
2 years ago
opearating system protection refers to a mechanism for controling access by programs, processes, or users to both system and use
Alekssandra [29.7K]

Answer:

The operating system must by the use of policies define access to and the use of all computer resources.

Policies are usually defined during the design of the system. These are usually default in settings. Others are defined and or modified during installation of the addon and or third-party software.

Computer Security Policies are used to exact the nature and use of an organisations computers systems. IT Policies are divided into 5 classes namely:

  1. General Policies
  2. Server Policies
  3. VPN Policies
  4. Back-Up Policies
  5. Firewall Access and Configuration Policies

Cheers!

5 0
4 years ago
Communication among office computers is based on a protocol that uses CRC-32 for error detection. A series of 100 identical test
Fiesta28 [93]
I think it is the CRC-32 for error detection
4 0
3 years ago
Who uses super computer
Delvig [45]
Aerospace, petroleum, and automotive industries
3 0
3 years ago
How to make an upside down exclamation point on mac?
denis-greek [22]
Option + 1

-----------------------------
5 0
3 years ago
Other questions:
  • Given a computer running four types of instuctions, named classes A through D, calculate the execution time of a program that ha
    5·1 answer
  • Objective:This assignment is designed to give you experience with thinking about algorithm analysis and performanceevaluation.Pr
    11·1 answer
  • Co to jest podprogram (procedura lub funkcja)? Zaznacz poprawną odpowiedź. a) Wielokrotne powtarzanie tych samych poleceń. b) Wy
    8·1 answer
  • TCP is the protocol responsible for the delivery of data on the Internet, and IP provides addresses and routing information.
    12·1 answer
  • Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.
    8·1 answer
  • Which of the following information should be included in audit documentation? a. Procedures performed. b. Audit evidence examine
    13·1 answer
  • Which professionals can benefit from an understanding of statistics? Check all of the boxes that apply. magician trying to locat
    5·2 answers
  • This is the term for the manual process of editing strips of the film before digital editing was created. The term is still used
    9·1 answer
  • Ivan wants to have code in a game that will make it possible to change the speed of a swimmer in the game. Which of these does I
    8·1 answer
  • How can she change that value so it is reflected in the chart in her presentation?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!