C#代写:CS3028 Phone Organiser


Practical Work

By using Microsoft Visual Studio 2017, develop an object-oriented console application that can organise phone records in a phone book. You have to realise a class phRecord holding the information of name, nickname, phone number (an 8-digit integer assuming not started with 0), email address, last-call date and time (e.g. 8 November 2018 13:09 can be represented by the string “1811081309”.) You also need to realise a class phBook holding a number of phRecord objects under three groups: Family, Friend and Junk. Every group can be realised as an array of phRecord objects. (Hence, a phBook object has three member arrays of phRecord objects.) The size of each array is assumed big enough and your application does not need to check this. The number of valid elements (phRecord objects) of each array can be kept inside the phBook object. While you are responsible for the final design of the console application, it should allow, upon the user’s request, the input of phone record and store it into a phBook object under one of the three groups specified by the user. Any record can be under more than one group and your application does not need to check this. Upon the user’s request, the application can display the information of phone records under a user-given group.

Within the phBook class, you are required to write public member function(s) to realise one of the following five tasks (of editing the phone book). The task to do should be determined by the remainder obtained from dividing your team number by 5. For example, if your team number is SEVEN, 7 % 5 = 2 and you should do Task 2) of this assignment.


The function removes the phone record of a user-input phone number under a user-given group. After the removal of a phone record, all the elements in the array that follow the removed record should be moved forward in order to assure the valid records are stored consecutively. Then, update the number of valid elements in that array accordingly. If, for whatever acceptable reason, the removal cannot be done, show an error message and then do nothing.

  • It is required that the classes and the implementation of their member functions should be built as a separate static library and linked into the console application.

  • Your console application is expected to provide a text-mode user interface so that users can repeatedly organise and display the content of the phone book until the user chooses to end the application.

  • Should you want to get a credit, you should design the console application such that when a user wants to start it, he needs to login with a username first, which will be checked with a file that stores username-password pairs. If the username is new, the application will ask for a password from the user and store it into that file. If the username can be found in that file, the application will ask for a password from the user and it will start only when the password is correct. The application will end if the user fails to provide the correct password in three consecutive trials.

  • Should you want to get a distinction, you should add and implement the following member functions in the class that:

    • i) Save of the content of the current phone book into a file
    • ii) Read the content of the current phone book from a file and store the information into the three group arrays.