hey can someone help me find the averages for each column that gets printed in the following code? im seething so hard rn
import java.util.*;
class SevenB
{
public static void main (String[]args)
{
//variable
int i=0;
int theirNumber;
int a=0;
int b=1;
int c=2;
int d=3;
int e=4;
int z=0;
Scanner scan= new Scanner(System.in);
//array setup
int[]fart=new int[20];
//NUMBER INPUT!!!!!!!!
//ask
System.out.println("What are the 20 numbers you want to input?");
//loops
while (i < 20)
{
theirNumber=scan.nextInt();
fart[i]=theirNumber;
i=i+1;
}
System.out.println();
//PRINT ARRAY!!!!!!!!
//priiiint
//
while(z < 4)
{
System.out.println("Row "+z+": "+fart[a]+" "+fart[b]+" "+fart[c]+" "+fart[d]+" "+fart[e]+" ");
z=z+1;
a=a+5;
b=b+5;
c=c+5;
d=d+5;
e=e+5;
}
//System.out.println("Average : "+ +" "+ +" "+ +" "+ +" "+ +" ");
}
}
Comments
Displaying 0 of 0 comments ( View all | Add Comment )