Guest User

Untitled

a guest
Feb 18th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. import java.util.*;
  2. import java.io.*;
  3. public class Main {
  4.  
  5.     /**
  6.      * @param args
  7.      */
  8.     public static void main(String[] args) throws Exception{
  9.         // TODO Auto-generated method stub
  10.         ArrayList<Abbonamento> Abbmti = new ArrayList<Abbonamento>();
  11.         Scanner input=new Scanner(System.in);
  12.         String name,sex;
  13.         boolean cond=true;
  14.         int old;
  15.         String scelta;
  16.         Abbonamento cliente;
  17.         File abbmti=new File("Lista_Abbonamenti.txt");
  18.         while(cond){
  19.             System.out.println("Inserire un altro utente ? s/n ");
  20.             scelta=input.next();
  21.             if(scelta.equals("n")) {
  22.                 cond=false;
  23.                 continue;
  24.             }
  25.             System.out.println("Nome del cliente: ");
  26.             name=input.nextLine();
  27.            
  28.             System.out.println("Sesso del cliente M/F");
  29.             sex=input.next();
  30.             System.out.println("Età :");
  31.             old=input.nextInt();
  32.             cliente=new Abbonamento(name,sex,old);
  33.             Abbmti.add(cliente);
  34.            
  35.         }
  36.        
  37.        
  38.      
  39.      
  40.     }
  41.  
  42. }
Add Comment
Please, Sign In to add comment