Nothing that i know of but then again im just average at java
|
|
whats wrong with it hurry im in skooolsCode:import java.util.Scanner; import static java.lang.System.*; public class lab07a { public static void main(String args[]) { for(int i = 0; i < 8; i++) { Scanner keyboard = new Scanner(System.in); int grade = keyboard.nextInt(); if((grade >= 90) && =< 100)) { out.println(""+grade+" is an A"); } else if(grade >= 80 && =< 89) { out.println(""+grade+" is an B"); } else if(grade >= 75 && =< 79) { out.println(""+grade+" is an C"); } else if(grade >= 70 && =< 74) { out.println(""+grade+" is an D); } else if(grade < 70 && >= 0) { out.println(""+grade+" is an F"); } else if(grade < 0) { out.println("THIS KID FAILS PERIOD"); } } } }
there is nothing wrong with it lol, thats why it is pissing me off
Fixed for you.Code:import java.util.Scanner; import static java.lang.System.*; public class lab07a { private static Scanner keyboard = new Scanner(System.in); public static void main(String args[]) { for(int i = 0; i < 8; i++) { int grade = keyboard.nextInt(); if(grade >= 90 && grade <= 100) { out.println(grade+" is an A"); } else if(grade >= 80 && grade <= 89) { out.println(grade+" is an B"); } else if(grade >= 75 && grade <= 79) { out.println(grade+" is an C"); } else if(grade >= 70 && grade <= 74) { out.println(grade+" is an D"); } else if(grade < 70 && grade >= 0) { out.println(grade+" is an F"); } else if(grade < 0) { out.println("THIS KID FAILS PERIOD"); } } } }
| « Index Help | need help with a small problem » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |