7.3.. Napisati program za ispis uspjeha, prema slijedeæoj tabeli:

Listing programa:

//07311004
package zad1;
import java.util.Scanner;
public class zad1 {

	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		System.out.println("Uspjeh");
		System.out.print("1-5");
		int ocjena = input.nextInt();
		switch (ocjena) {
		case 1:
			System.out.println("Nedovoljan");
			break;
		case 2:
			System.out.println("Dovoljan");
			break;
		case 3:
			System.out.println("Dobar");
			break;
		case 4:
			System.out.println("Vrlo dobar");
			break;
		case 5:
			System.out.println("Odlican");
			break;
		
		default:
			System.out.println("Unijeli ste pogresnu ocjenu. ");
			break;
		}
	}
}

Ispis na ekranu:

Index