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
Alex_Xolod [135]
3 years ago
10

Write a function, AvgList, that takes a single argument, a list, and returns the average (mean) of the numbers in the list. You

may assume that all elements of the list are numeric (int or float), and that the list has at least one element. Hints: Use the function SumList that you wrote above. Use the built-in function len to get the number of elements in the list.
Computers and Technology
1 answer:
8_murik_8 [283]3 years ago
3 0

Answer:

Answered below

Explanation:

//Programmed in Java

public double avgList(int [] nums){

int I;

double sumOfNumbers = 0;

double averageOfNumbers = 0;

//Loop over to sum all elements in the list.

for(I = 0; I < nums.length; I++){

sumOfNumbers += nums[I];

}

//Calculate the average

averageOfNumbers = sumOfNumbers/ nums.length;

return averageOfNumbers;

}

You might be interested in
How to do a row of circles on python , with the commands , picture is with it .
kotykmax [81]

Answer:

o.o

Explanation:

5 0
3 years ago
Bloxburg Build can anyone help me
postnew [5]
Om I would love to helpppp friend me- keabbykelp
5 0
3 years ago
Read 2 more answers
Which of the following tasks is least effective at preventing a computer virus?
Ksivusya [100]

Answer:

all of the above mentioned

5 0
3 years ago
Read 2 more answers
Concept tests in the screening and evaluation stage of the new-product process rely on written descriptions, sketches, or mock-u
pochemuha

Answer:

The answer is "Actual products".

Explanation:

The key purpose of this research is to better analyze the concepts, which is done to establish customer buying expectations and perceptions of the item. The key point is to assess the consumers ' initial response to the product idea.

  • This concept testing is also known as a creation, it is an advantage, which can be conveyed to the user to test their reactions.  
  • In conceptual testing, it is a quality check between the design definition and the actual production of the product.

6 0
4 years ago
Design a RomanNumerals class that takes a number within 1 to 10 and display the Roman numeral version of that number (I, II, III
Alla [95]

Answer:

Explanation:

The following code is written in Java. It  creates a RomanNumberals class with all of the requested methods, including a convertNum method and displayResults method. The user is then asked to input a number within the main method. A RomanNumeral object is created, passed the userInput and all of it's methods are called for testing. A test output can be seen in the attached image below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter a number: ");

       int number = in.nextInt();

       RomanNumerals romanNumeral1 = new RomanNumerals();

       romanNumeral1.setNumber(number);

       System.out.println("Test getNumber Method: " + romanNumeral1.getNumber());

       romanNumeral1.convertNumber();

       romanNumeral1.displayResult();

   }

}

class RomanNumerals {

   int number;

   String romanNumeral;

   public RomanNumerals() {

   }

   public int getNumber() {

       return number;

   }

   public void setNumber(int number) {

       this.number = number;

   }

   public void convertNumber() {

       switch (this.number) {

           case 1: romanNumeral = "I"; break;

           case 2: romanNumeral = "II"; break;

           case 3: romanNumeral = "III"; break;

           case 4: romanNumeral = "IV"; break;

           case 5: romanNumeral = "V"; break;

           case 6: romanNumeral = "VI"; break;

           case 7: romanNumeral = "VII"; break;

           case 8: romanNumeral = "VIII"; break;

           case 9: romanNumeral = "IX"; break;

           case 10: romanNumeral = "X"; break;

           default: System.out.println("Not a valid number"); break;

       }

   }

   public void displayResult() {

       System.out.println("Number " + this.number + " is represented as " + this.romanNumeral);

   }

}

7 0
3 years ago
Other questions:
  • If someone were unable to pay cash right now, which financing option would be best for the laptop and for the refrigerator?
    10·2 answers
  • You are reviewing the style sheet code written by a colleague and notice several rules that are enclosed between the /* and */ c
    12·1 answer
  • Which technology can allow a single ground-based telescope to achieve images as sharp as those from the Hubble Space Telescope?
    7·1 answer
  • If you write a toString method to display the contents of an object, object1, for a class, Class1, then the following two statem
    7·1 answer
  • Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times
    6·1 answer
  • _is necessary for the health growth of bones and teeth fill ups​
    8·2 answers
  • Select the correct answer from each drop-down menu.
    5·2 answers
  • I just need question 2 answered. Someone please help I’m on a test!
    10·1 answer
  • Fire stick optimizing system storage and applications
    10·1 answer
  • Briefly explain how human thinking is mapped to artificial intelligence components
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!