Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can anyone solve this java script method question please? 1.Write a method called getNumbers that takes no parameters and returns an array of integers. In

Can anyone solve this java script method question please?

1.Write a method called getNumbers that takes no parameters and returns an array of integers. In the method, write a loop to allow the user to enter as many integers as they like. Store these in an array called numArray and return the array when the user is done.

2.Write a method called calcAverage that takes an array of integers as a parameter and returns a double. Compute the average of the integers in the array that is passed and return this value.

3.

Call both methods above from the main method. The pseudocode for the main method is as given below. Then print the average with a statement "The average of the numbers is: X" where X is the average you calculated. (4 points)

Get the numbers from the user Compute the average Print the average to the command line.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago