Professional Documents
Culture Documents
/**
*
* @author User
*/
public class JavaApplication1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
while (number != 0) {
total=total+number;//adding current number to new added number then
placing it again in total variable
counter++;//incrementing the count
totalcount = counter;//placing the current count to a temporary
variable
if(counter != 0){
average = total/totalcount;
System.out.println("Your average grade is "+average);//Printing average
of all the grades inputted
System.out.println(total);
System.out.println(totalcount);
}
else
{
System.out.println("No grade were entered");
}
}
}