CS 210 Assigned: March 21, 2016 Programming Assignment 7 Due: April 4, 2016

advertisement
CS 210
Programming Assignment 7
Phone Directory
Assigned: March 21, 2016
Due: April 4, 2016
This is a telephone directory application in which the user can open a text file of names,
phone numbers and notes. Begin by creating a form similar to that shown in Figure 1.
The form has the following items:
Two labels with text "Directory" and "Search for"
One list box that has a right vertical scroll bar. The list box should be sorted.
One text box under the "Search for" which is single line.
One text box that is multi-line that has no accompanying label. This is the text box
where results are displayed.
One Main menu with heading "File" which has three entries called "Open", "Save As",
and "eXit".
One button labeled "Search".
One button labeled "Add".
To use the program the user clicks on File → Open and opens a text file containing the
names, phone numbers, and notes. The program displays the contents of this file as
strings in the list box under the "Directory" label. If the user double clicks on an entry in
the text box, the complete text for that line is displayed in the result text box to the right.
The user can also enter any first name, last name, phone number, or phrase from a note in
the "Search for" text box and click on the Search button. The program should then search
through the items in the directory for the item. If the item is found the entire text line for
that item should be displayed in the result text box. The user should also be able to add
new data to the directory by entering the line in the result text box and clicking on the add
button. The added item should be immediately listed in the list box.
Figure 1
The form for the phone directory problem.
The phone directory text file should always have a txt file extension and it should be in
the following comma separated format:
LastName1, FirstName, PhoneNumber, Note
LastName2, FirstName, PhoneNumber, Note
LastName3, FirstName, PhoneNumber, Note
An example of a typical set of entries might be something like this:
McGillicuddy, Mabel, 479-1234, My old girlfriend.
Smith, Charles, 479-4321, My second grade teacher.
A sample text file with a bogus phone directory is on the web site with the assignment.
Your program should use a class for the data. Typically this class would have four string
private variables that support the four entries for each line in the phone directory. The
private variables should be accessed through properties.
After you get your program running correctly, place a copy of the design into the project
folder as a doc or docx file. Right click on the project folder and choose Send To →
Compressed zip file. Rename the compressed zip file as Asn07XXX.zip where XXX are
you three initials. Upload the renamed file to \\cecsfp01\users\everyone\engr123.
Related documents
Download