I am creating a program where I must get the scores from several users and then print the highest and lowest score. I have attempted to do this by creating the loop and asking for the score and name then creating new variables for the high and lows attempted both in and out of the loop but it has not worked any help would be greatly appreciated!
/* Name: Armaan and Kenny * Date: * Course: * Description: */
import hsa.Console;
import java.awt.*;
public class testPilo
{
static Console c;
public static void main(String[] args)
{
c = new Console();
int i = 0;
int a = 0;
int y = 0;
String x = "";
String bigBoy = "";
String lilBoy = "";
int highest = 0;
int lowest = 0;
c.println("How man players do you want?");
a = c.readInt();
while(true){
if(y >= highest){
bigBoy = x;
highest = y;
}
i++;
c.println("enter the name of gamer #"+i);
x = c.readString();
c.println("What is your score "+x+"?");
y = c.readInt();
highest = y;
lowest = y;
if(y <= lowest){
lilBoy = x;
lowest = y;
}
if(i == a) break;
}
c.println("The highest is "+lilBoy);
c.println("The lowest is "+bigBoy);
}
}