Guest User

What am I Doing wrong? Java

a guest
May 11th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. package generalPractice1;
  2. /*
  3.  * Practice Problem:
  4.  *   - There are a ton of students and you need to determine what letter grade each student got depending on their
  5.  *     percentage.
  6.  *   - Print out how many of each letter grade there are using a count variable.
  7.  *   - print each student's name along with their percentage and grade letter. One student per line.
  8.  */
  9.  
  10. public class Main {
  11.     public static void main(String[] args) {
  12.         int[] grades = {30, 60, 85, 50, 90, 40, 90, 95, 99, 54};
  13.         String[] students = {"Harry", "Josh", "Kyle", "Katelyn", "Tommy", "Jackson", "Jane", "Conner", "Paul", "Nancy"};
  14.        
  15.        
  16.     }
  17.     public static void checkGrades() {
  18.         for (int i: grades) {
  19.             System.out.println(i);
  20.            
  21.             if (i >= 90) {
  22.                 System.out.println("This user has an A!"); }
  23.             else if (i >= 80) {
  24.                 System.out.println("This user has a B!"); }
  25.             else if (i >= 70) {
  26.                 System.out.println("This user has a C!"); }
  27.            
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment