Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package phone;
- import java.util.Scanner;
- import java.util.ArrayList;
- public class Phone {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- String name;
- double number;
- ArrayList<Double> PhoneList = new ArrayList<Double>();
- while(true){
- System.out.println("What is the name:");
- name = keyboard.nextLine();
- System.out.println("What is the phone number:");
- number = keyboard.nextInt();
- System.out.println("Would you like to add another computer?(yes/no)");
- String again = keyboard.nextLine();
- if (again.equals("no"))
- {
- System.out.println("Thank you for entering these numbers ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment