CMPT 270 Assignment 1 Java Basics, Object Types and Features solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)

Question 1 (20 points):
Purpose: Practising Java Syntax and Programming
Degree of Diculty: Easy.
(a) (5 points) Implement a Java class called ArrayAverager that uses a method named average to return
the average value of an array of type double, as done in this python snippet:
✞ ☎
def Average ( S ):
total = 0
for x in S :
total = total + X
average = total /len ( S)
return average
✝ ✆
On moodle you will nd a starter le titled ArrayAverager.java with the main method already implemented. Your task is to complete the TODO’s in this le. Once these are correctly implemented your
program should display a value of 3.25 to the console.