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
Ede4ka [16]
2 years ago
14

Write a method with the signature "float sumArray(float[] data)" that takes an array of floats, and returns their sum.

Computers and Technology
1 answer:
My name is Ann [436]2 years ago
8 0

Answer:

I will code in JAVA.

Preconditions:

  • The float array of data are declared and initialized.

public float sumArray(float[] data) {

float sum = 0;

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

   sum = sum + data[i];

  }

return sum;

}

Explanation:

First, you have to declare a variable sum of type float and initialize with 0. In addition, this method has a for-loop to go through whole array of data and each element is added to the float value to sum. When the for loop ends, the sum variable is returned.

You might be interested in
Why are rules required for a number system to be useful?
evablogger [386]

Answer

This is because without them no one would know how much each symbol represents, and no one would be able to decipher the message.

Explanation

Number system is a way to represent numbers. It  is a writing system for expressing numbers; that is, a mathematical notation for representing numbers of a given set, using digits or other symbols in a consistent manner.

In computing or in a computer number systems are the techniques which represents numbers in the computer system architecture where   every value that you are saving or getting into/from computer memory has a defined number system.Computer architecture supports  . Binary number system,Octal number system and Decimal number system.

5 0
2 years ago
Read 2 more answers
The class constructor function must have the same_______ as the class,
inn [45]

Answer:

Name.

Explanation:

The constructor in the class must have the same name as the class.Constructors are used to initialize the object when created.There are basically three types of constructors which are as following:-

  1. Default Constructor.
  2. Parameterized Constructor.
  3. Copy Constructor.

Default Constructor:-This constructor is already present in the class when the class is defined.It does not have any arguments.

Parameterized Constructor:-As the name suggests this constructor have parameters that are used to initialize the object.

Copy Constructor:-This constructor is called whenever an object is copying the values of other object.For example:-

There is already an object present with name obj1.

class obj2=obj1;

5 0
3 years ago
How would you define the rule of thirds?
mixer [17]

A pronciple of composition used fir centuries by artists and photographers or it is a method when used to frame a composition properly

8 0
3 years ago
An organization is looking to add a layer of security by implementing a solution that protects hosts against known and unknown m
klio [65]

Answer: D) Whitelisting

Explanation:

Whitelisting are used in many applications and it only allows the good known apps. Whitelisting are majorly used for security purpose as, it permits to maintain or control the misuse the apps by employees in an organisation.

Blacklisting maintain the list of denied access system and it prevented the accessing undesirable program. It is also used as security application but it is less effective than whitelisting.

Encryption are the process which are not used in the restricting application. And lockout are used by the users for entering the password for many time as possible.  

Therefore, option (A) is correct.

4 0
3 years ago
Sensors send out ............ signals​
son4ous [18]

Answer:

mhmm................... ok

3 0
3 years ago
Other questions:
  • Graphic images can be stored in a variety of formats including ____.
    15·1 answer
  • Which player type focuses on level progression?
    13·1 answer
  • What font option will elevate part of the text to a higher level and decrease its size? A. Subscript
    8·1 answer
  • Name two ways you can identify the pid number of the login shell.
    13·1 answer
  • ________ is the process the compiler uses to divide your source code into meaningful portions; the message means that the compil
    7·1 answer
  • Biểu diễn cây sau bằng mảng một chiều
    12·1 answer
  • Why is dark supereffective against ghost?
    5·2 answers
  • I need help for my computer science class I would appreciate it
    11·1 answer
  • Developed the first compiler and conducted work that led to the development of COBOL ?
    6·1 answer
  • To stored three characters a computer occupies. Bytes memory space
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!