Description
This program is for practicing File IO. You need to develop People Class and PhoneBook Class to construct a simple system that can manage the functions of PhoneBook.
Assignments Documentation:
At the beginning of each programming assignment you must have a comment block with the
following information:
/*————————————————————————— // AUTHOR: (Put your name here)
// FILENAME: Lab12.java
// SPECIFICATION: This program is for practicing File I/O.
// LAB LETTER: (Put your Lab Letter here) //————————————————————————-*/
Important Instruction:
Part1:
In this Lab, you should first use your program to complete following tasks on your own computer:
- ● Add one record, name: Jack, number: 1234567890
- ● Add one record, name: Anna, number: 2345678901
- ● Save your current records
Part2:
Submit your three source code files and the saved records file in Part1.Getting Started: People Class
PhoneBook Class
Here is the template of PhoneBook Class:
Here is the Coding guideline:
Command Program: Lab12
Here is the template of Lab12 Class:
Here is the Coding guideline:
Sample output1:
Select the action that you want to perform: 1. Add a record. 2. Delete a record. 3. Read records from file.
4. Save your records. 5. Exit. Enter action number (1-5): 1
Input the name of the record:
Jack
Input the phone number of the record:
1234567890
name number
Jack 1234567890
Select the action that you want to perform: 1. Add a record.
2. Delete a record.
3. Read records from file.
4. Save your records.
5. Exit.
Enter action number (1-5):
Input the name of the record:
Anna
Input the phone number of the record: 2345678901
name number
Jack 1234567890
Anna 2345678901
Select the action that you want to perform: 1. Add a record.
2. Delete a record.
3. Read records from file.
4. Save your records.
5. Exit.
Enter action number (1-5):
4
Save Successfully!
Select the action that you want to perform: 1. Add a record.
2. Delete a record.
3. Read records from file.
4. Save your records.
5. Exit.
Enter action number (1-5):
5
Exiting the Program…
Sample output2:
Select the action that you want to perform: 1. Add a record. 2. Delete a record. 3. Read records from file.
4. Save your records. 5. Exit. Enter action number (1-5): 3
name number
Jack 1234567890
Anna 2345678901
Select the action that you want to perform:
1. Add a record.
2. Delete a record.
3. Read records from file.
4. Save your records.
5. Exit.
Enter action number (1-5):
2
Input the name of the record you want to delete: Jack
name number
Anna 2345678901
Select the action that you want to perform:
1. Add a record.
2. Delete a record.
3. Read records from file.
4. Save your records.
5. Exit.
Enter action number (1-5):
5
Exiting the Program…