C# - C Sharp: Practical 6: Phonebook Management System
Giải phóng thời gian, khai phóng năng lực
EXERCISE 1: PHONEBOOK MANAGEMENT SYSTEM
1. Create an interface IPhoneBook contains these methods:
- void InsertPhone(string name, string phone)
- void RemovePhone(string name)
- void UpdatePhone(string name, string newphone)
- void SearchPhone(string name)
- void Sort()
2. Create class PhoneBook implements interface IPhoneBook
- Create a SortedList object to store data
- Method InsertPhone:
If the name is new, add the name and phone to the phonebook
If the name already exists, add new phone after old phone
( Ex: “0912333333 : 0902345671” )
- Method RemovePhone:
Remove phone from the sorted list.
- Method UpdatePhone:
Replace old phone with new phone
- Method SearchPhone:
Search the phone of input name
- Method Sort:
Sort items in the phonebook by name
3. Create Menu:
PHONEBOOK MANAGEMENT SYSTEM
1. Insert Phone
2. Remove Phone
3. Update Phone
4. Search Phone
5. Sort
6. Exit
Giải phóng thời gian, khai phóng năng lực