Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package exercicios;
- import java.util.Scanner;
- public class ex1 {
- public static void main(String[] args) {
- int nota;
- Scanner sc = new Scanner(System.in);
- boolean notavalida=false;
- System.out.println("Nota: ");
- nota = sc.nextInt();
- do{
- if(nota >=0 && nota <=10){
- System.out.println("Digitou: "+nota);
- notavalida = true;
- }else{
- System.out.println("Nota inválida.");
- }
- }while(notavalida=false);
- }
- /* César N. */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement