/* This is a basic program that uses a while loop It asks the user for a series of grade Then it calculates the average of the grade Hence, it determines the letter grade and print it out * */ import java.util.Scanner; public class Whileloop { public static void main(String[] args) { Scanner key = new Scanner(System.in); double grade; int num; int i=0; double sum = 0.0, ave = 0.0; // Here will deteremine how many times we will loop System.out.print("How many grades are you planning to input\n"); num = key.nextInt(); /* Creates a while loop with "num" of times, starting at 0 The loop will exit once i is greater than or equal to num * */ while(i=90) { System.out.print("You recieve an A\n"); } else if(ave>=80) { System.out.print("You recieve a B\n"); } else if(ave>=70) { System.out.print("You recieve a C\n"); } else if(ave>=60) { System.out.print("You recieve a D\n"); } else { System.out.print("You recieve a F\n"); } } }