Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @(#)HansonJ002PA2
- * @author Hanson John
- * @version 1.00 2019/3/18 3:42 PM
- *
- * Program Purpose: Organize Address Book into Family & Friends
- */
- import java.util.Scanner;
- public class HansonJ002PA2
- {
- public static void main(String [] args)
- {
- char another = ' ';// to collect additional input
- String name = "";// collects users name
- String addressee = "";// collects the name of the addressee
- String street = "";// collects street of addressee
- String cityStateZip = "";// collects cityStateZip of address
- String phone = "";// collects the phone number of addressee
- String family = String.format("%nFAMILY%n");// lists addressee as family
- String friends = String.format("%nFRIENDS%n");// lists addressee as friend
- StringBuilder phoneFormatted;// collects the format used while inputing the phone number
- int relationship = 0;// collects the input of the relationship between user and addressee
- int bookType;
- char correct = ' ';
- Scanner input = new Scanner(System.in);
- System.out.printf("%nBegin entering addresses? \'Y\' or \'N\' ");
- another = input.nextLine().charAt(0);
- if(Character.toUpperCase(another) != 'Y')
- {
- System.out.printf("%nExiting Program%n");
- }
- while(Character.toUpperCase(another) == 'Y')
- {
- System.out.printf("Address Book Type\n 1. Personal\n 2. Buisness\nChoose from above the address book type:");
- bookType = input.nextInt();
- input.nextLine();
- do
- {
- switch(bookType)
- {
- case 1: System.out.printf("%nYou entered 1. for Personal. Is this correct? 'Y' or 'N' ");
- correct = input.nextLine().charAt(0);
- break;
- case 2: System.out.printf("%nYou entered 2. for Personal. Is this correct? 'Y' or 'N' ");
- correct = input.nextLine().charAt(0);
- break;
- }
- if(bookType != 1 && bookType != 2 )
- {
- System.out.printf("%nYou entered %d which is the wrong address book type. Try again. ", bookType);
- correct = 'N';
- input.nextLine();
- }
- }while(Character.toUpperCase(correct) == 'N');
- /**do
- {
- }
- while(); //Booktype validation
- do
- {
- do
- {
- }while();//Addresse validation
- do
- {
- }while();//Street address validation
- do
- {
- }while();//City State Zip validation
- do
- {
- }while();//Phone Number validation
- do
- {
- switch(relationship)
- {
- }
- }while();//Relationship validation
- switch(relationship)
- {
- }
- }while();
- switch(bookType)
- {
- }//Print addressbook as personal or business
- System.out.printf("%nWant to create another address book? \'Y\' or \'N\' ");
- another = input.nextLine().charAt(0);
- */
- }//END WHILE
- }//END main()
- }//END application class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement