Hey guys I got a problem, my program is suppose to take 10 numbers or grade scores and output the max, min and avg. score. My program writes out the max and the avg, although the avg dosent come out correctly because i am not getting a min for a number i am just getting 0. IK why it is reading 0 is because that is what have my int min set too. but when i remove = o just says int min does not exist for the rest of the code. here is my code thanks!
/**
* @(#)Week_seven_number_twenty_eight.java
*
* Week_seven_number_twenty_eight application
*
* @author: Patrick Thompson
* @version 1.00 2012/3/14
*/
import javax.swing.JOptionPane;
public class Week_seven_number_twenty_eight
{
public static void main(String[] args)
{
int count = 0;
int max = 0;
int min = 0;
int avg = 0;
int Total = 0;
for(int i = 1; i < 11;i++)
{
String NUMBER = JOptionPane.showInputDialog(null,"Please Enter a grade number");
int Number2 = Integer.parseInt(NUMBER);
System.out.println(+Number2);
if(Number2 < min)
{
min = Number2;
}
if(Number2 > max)
{
max = Number2;
}
count++;
Total =+ Number2;
}
avg = Total / count;
System.out.println("Number of values = " + count);
System.out.println("Maximum = " + max);
System.out.println("Minimum = " + min);
System.out.println("Average = " + avg);
}
}