Programming Reference/Librarys
Question & Answer
Q&A is closed
This is an old revision of the document!
package schoolnotes; import java.util.Scanner; public class Schoolnotes{ public static void main(String[] args) { int note; Scanner scan = new Scanner(System.in); System.out.print("Please enter a note: "); note = scan.nextInt(); switch(note) { case 1: System.out.println("very well"); break; case 2: System.out.println("good"); break; case 3: System.out.println("satisfactory"); break; case 4: System.out.println("sufficient"); break; case 5: System.out.println("deficient"); break; case 6: System.out.println("insufficient"); break; default: System.out.println("Not a valid note"); } } }
Please enter a note: 4 sufficient