首页 > > 详细

Help With C/C++ Experiment,C/C++ Programming Help,Writing C/C++ Homework ,C/C++ Homework Writin

Department of Electronic Information Engineering Page 1
C++ Application Development Assignment – 4

Email Handler

Practical Work
By using Microsoft Visual Studio 2015, develop an object-oriented console application that can handle emails.
Your program is NOT expected to be able to send emails. It is for providing the environment to build a database
of the emails, displaying and handling the database content. While you are responsible for the final design of
the console application, your program is expected to realise a class cEmail representing an email that contains
the following:
• Member variables including the fields To_From (that contains a name followed by an email address put
inside a pair of square brackets, and a character to indicate whether it is a sent-to-receiver or received-from-
sender message), Subject, Cc (that contains a name followed by an email address put inside a pair of square
brackets), Message, and Date (e.g. 9 November 2017 can be represented by the integer 171109). Notice
that the first 4 member variables are for storing a string, while the member variable Date is of type int.
• Member functions for reading and writing the member variables in cEmail.
Write a function to build up the database that keeps the emails ever sent or received by obtaining the information
from the user. The database can be realised by an array of a finite size, which is assumed big enough and your
program does not need to check this. However, checking for valid email addresses is needed in order to ensure
only one character ‘@’ is inside an address with some characters before and after the character it (e.g.,
). Then, develop the class Em_Han with public member function(s) to process the content of the
database. You are required to write member function(s) to realise one of the following five tasks (of processing
the email database). 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, you should do Task 2) of this assignment.

Task:
0) The member function performs the sorting of the received emails based on the name of the sender (within the
To_From field) in ascending order, and display a sorted list of sender name, subject and date of sending.
[Hint: To do the sorting, notice that strcmp("Peter","Mary") will return 1, meaning that "Peter" is
larger than "Mary". Similarly, strcmp("Mary", "Peter") will return 1, strcmp("Mary","Mary")
will return 0.] Notice that you can ignore the sent-to-receiver messages.
1) The member function performs the sorting of the sent emails based on the name of the receiver (within the
To_From field) in ascending order, and display a sorted list of receiver name, subject and date of receiving.
To do the sorting, read the hint in Task 0). Notice that you can ignore the received-from-sender messages.
2) The member function performs the sorting of the emails based on the date in descending order, and display a
sorted list of date, name, and subject together with a string indicating it is a sent or received message.
3) The member function performs the sorting of the emails based on the subject in ascending order, and display
the sorted list of subject, name, and date together with a string indicating it is a sent or received message.
To do the sorting, read the hint in Task 0).
4) The member function asks the user to input a name, and display a numbered list of subject and date of the
email together with a string indicating it is a sent or received email under that name. The user can then enter
a number and the corresponding email will be deleted from the database. [Hint: You can add a member
variable in the cEmail class that specifies whether it is a valid email. If an email is deleted from the
database, that email becomes an invalid email. On displaying the content of the database, only valid emails
will be shown.]
 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 program is expected to provide a text-mode user interface so that users can repeatedly handle and
display the database of emails until the user chooses to end the application. Also, all the member functions
defined in the class cEmail and Em_Han must be tested by this console application.
 Should you want to get a credit, you should design the application such that when a user wants to start it, he
needs to login the application with a username first, which will be checked with the content of a file that
stores username-password pairs. If the username is new, the application will ask for a password from the
Department of Electronic Information Engineering Page 2
The Hong Kong Polytechnic University
2

user and store it into that file. If the username can be found in that file, the application will start only if 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 Em_Han that:
i) Save the current database into a file
ii) Build the database from the file obtained by i) above.


Report
Your report should include:
Abstract: Summarise the objectives and achievement of your assignment in less than 100 words.
1. Introduction: Describe the objectives and requirements of the assignment in detail, and give a brief account
of the methodology.
2. Methodology: It contains
 How your team divides the work among the team members (very important, to be used as the basis for
assessment)
 The schedule and stages of developing the project
 The structure of the developed program, including
 The specifications of the classes defined, and the public/private member functions/variables inside -
explain as far as possible why your group makes such choices of members
 The flow of program. (It is good to include a flow chart to help illustration.)
 What problems your group encounters, and how your group solves the problems
 Testing of your program, which shows
 How you validate your program, i.e. confirm that the solution is correct.
3. Results
 Include the results of executing your program captured from the screen.
4. Conclusion and further development
 Summarize the experience gained in the assignment
 Indicate how your program can be extended and improved if more time is allowed.

The report should be in PDF format with your class number, team number, student names, student IDs and task
number at the front page. It is NOT required to include the complete source code in the report. Instead, you
should zip the folder(s) containing all your project files into a zipped file, which also stores the report. (See the
General Description below.)


General Description
1. Each team should comprise TWO students. Students must obtain prior approval from the subject lecturer if
they want to form. a team with fewer or more team members.
2. Unless you get prior approval from your subject lecturer/tutor, you must observe the following:
 Do NOT use any technique or C++ constructs not taught in the subject
 Unless mentioned on this instruction sheet, any library function not mentioned in the subject must NOT
be used.
3. Each team should upload the zipped file to
“lnx01.ee.polyu.edu.hk/~eewlchan/ENG2002/AppDevelopment/Submit” on or before 6 Dec. 2017.
4. It is your duty to assure your submitted application can be built using Visual Studio 2015, and run in Command
Prompt. Assessment will only be made based on your submitted zipped file. To lower the chance of
Department of Electronic Information Engineering Page 3
The Hong Kong Polytechnic University
3

incomplete submission, for submission, you are advised to zip one whole project folder that contains all
folders and files in the projects of this assignment.
5. The documentation for your assignment is important. The ability of writing good comments in the program
will also be an important factor to the final assessment of your assignment.
6. It is compulsory to use a word processing tool to write your report. The font size must not be bigger than
12 or smaller than 10. Use 1.5 lines spacing on both sides of a page. Including all figures and tables, if
any, the length of the report should not be shorter than 7 pages.
 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!