Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. package first_try;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class first_class
  6. {
  7.     public static void main(String[] args)
  8.     {
  9.         Scanner sc = new Scanner(System.in);
  10.        
  11.         String prenom;
  12.         char reponse = 'o';
  13.        
  14.         while(reponse == 'o')
  15.         {
  16.             System.out.print("Saisissez votre prénom : ");
  17.             prenom = sc.nextLine();        
  18.            
  19.             reponse = ' ';
  20.            
  21.             while(reponse != 'o' && reponse != 'n')
  22.             {
  23.                 System.out.print("Voulez vous recommencer ? : ");
  24.                 reponse = sc.nextLine().charAt(0);             
  25.             }
  26.         }
  27.     }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement