I have the Winter Class and need help writing the code for the main class: The winter
Fantastic news! We've Found the answer you've been seeking!
Question:
I have the Winter Class and need help writing the code for the main class:
The winter class:
public class Winter { private int[] nums; static int Index=0; //to keep track of number of integers public Winter(int n)//constructor { nums=new int[n]; } //whenever int is added //increase Index public void add(int num) { nums[Index]=num; Index++; } public int sum() { int SUM=0; for(int I=0;IMAX)//if any elemnt higher than MAX { MAX=nums[I]; } } return MAX; } public int low() { int MIN=nums[0]; for(int I=0;I thresh) { SUM=SUM+nums[I]; Count++; } } AVG=(double)SUM/Count; return AVG; } public int count() { //return Index return Index; }
the main class: (the instructions are written as comments) but i need help getting the single integer from scanner and writing the loop.
main class:
Related Book For
Practical Introduction To Data Structures And Algorithm Analysis Java Edition
ISBN: 9780136609117
1st Edition
Authors: Clifford A. Shaffer
Posted Date: