Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with the pseudocode and the code, please! Write a Java application t

ID: 3761730 • Letter: I

Question

I need help with the  pseudocode and the code, please!

Write a Java application that allows a user to enter the names and phone numbers of up to 10 friends. Use two arrays - one for the names and another for the phone numbers. Recall this is known as a "parallel array". Continue to prompt the user for names and phone numbers until the user enters "zzz" or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, but make certain not to count the application-ending dummy "zzz" entry. Then display the names and phone numbers. Ask the user to enter one of the names in their "phone book" and display the corresponding phone number. FIRST, write the pseudocode for your application. Write down step by step what your program should do. You may use either flow charting or pseudocode.

Explanation / Answer

import java.util.Scanner;
public class PhoneBook
{
Scanner keyboard = new Scanner(System.in);
PhoneBook MyPhoneBook ;
public static void main(String args[])
{
Scanner keyboard = new Scanner(System.in);
PhoneBook MyPhoneBook = new PhoneBook();
MyPhoneBook.setName("Private PhoneBook");
while (true)
{
System.out.print("Please enter a name: ");
String name = keyboard.next();
if (name.equals("end"))
{
break;
}
System.out.print("Please enter their phone number: ");
String phonenumber = keyboard.next();
Person p = new Person(name, phonenumber);
MyPhoneBook.addPerson(p);
}
MyPhoneBook.listPhoneBook();
MyPhoneBook.writePhoneBook(MyPhoneBook);
PhoneBook newPhoneBook = new PhoneBook();
String file = "phonebook.java";
newPhoneBook = newPhoneBook.readPhoneBook(file);
newPhoneBook.setName("Readed serialized PhoneBook");
newPhoneBook.listPhoneBook();
String s;
if ((s=newPhoneBook.findPerson("zzz")) != null)
{
System.out.println("zzz was found with phone number: " + s);
}
}
}