package com.profjpbaugh.module1;

import java.util.Scanner;

public class Grades {

	public static void main(String[] args)
	{
		int input = 0;
		int total = 0;
		double percentage = 0.0;
		Scanner keyboard = new Scanner(System.in);
		
		for(int i = 0; i < 5; i++)
		{
			System.out.println("Please enter a value");
			input = keyboard.nextInt();
			total += input;  //total = total + input;  
		}//end for
		
		percentage = total / 5.0;
		
		System.out.println("Your percentage is " + percentage);
		
		
		//now, letter grade!
		
		if(percentage >= 90)
		{
			System.out.println("You got an A!");
		}
		else if(percentage >= 80 && percentage < 90)
		{
			System.out.println("You got a B!");
		}
		else if(percentage > 70 && percentage < 80)
		{
			System.out.println("You got a C!");
		}
		else if(percentage >= 60 && percentage < 70)
		{
			System.out.println("You got a D!");
		}
		else
		{
			System.out.println("You got an F!");
		}
	}
}
