Help with Programming Assignment

Assignment Description

Get the best assignment help from MakeMyAssignments.com

Programming Assignment Help

Stage 1: Data Entry

Write a program which requests that the user enters a name and email address. Store that data in a List. After the user has entered data, request that the user enters Y or N to continue. If they enter N, print the list of names and email addresses to the screen. If they enter Y, repeat the first step.

Your program should produce the following result:

Mailing List Manager
Enter a name: Gaye Deegan
Enter an email address: gaye.deegan@unisa.edu.au
Gaye Deegan at gaye.deegan@unisa.edu.au has been recorded.
Do you wish to enter another account? (Y/N) Y
Enter a name: Ben Martini
Enter an email address: ben.martini@unisa.edu.au
Ben Martini at ben.martini@unisa.edu.au has been recorded.
Do you wish to enter another account? (Y/N) N
1. Gaye Deegan: gaye.deegan@unisa.edu.au
2. Ben Martini: ben.martini@unisa.edu.au
Thankyou.

Stage 2: Validation

Building on stage 1, you now need to ensure that the program checks for valid entries in each case, and converts the text to the appropriate format.

You need to:

  • Ensure that a name and email address was entered, If either the name or email is empty, do not record that item and go straight to asking if they wish to continue.
  • Convert the name to title case, and the email to lower case.
  • Ensure that the user enters either "Y", "y", "N" or "n" when asked if they wish to continue. Continue to ask until they enter a valid result.
  • For extra marks, ensure that the email contains an "@" sign. This was not covered in the course, so will require extra research. If it does not contain "@", as the user to enter the email again.

Sample output:

Mailing List Manager
Enter a name: Gaye Deegan
Enter an email address: gaye.deegan@unisa.edu.au
Gaye Deegan at gaye.deegan@unisa.edu.au has been recorded.
Do you wish to enter another account? (Y/N) yes
Do you wish to enter another account? (Y/N) y
Enter a name:
No record has been recorded.
Do you wish to enter another account? (Y/N) Y
Enter a name: BEN MARTINI
Enter an email address: Ben.Martini.unisa.edu.au
Enter an email address: Ben.Martini@unisa.edu.au
Ben Martini at ben.martini@unisa.edu.au has been recorded.
Do you wish to enter another account? (Y/N) N
1. Gaye Deegan: gaye.deegan@unisa.edu.au
2. Ben Martini: ben.martini@unisa.edu.au
Thankyou.

Stage 3: Objects and Persistance

This involves two separate jobs:

  • Create a class to store the details of the account rather than using a List on its own. Employ the Class in your code.
  • Store the account details in a text file, and load then when next the program is launched.

Sample Output

Mailing List Manager
Enter a name: Gaye Deegan
Enter an email address: gaye.deegan@unisa.edu.au
Gaye Deegan at gaye.deegan@unisa.edu.au has been recorded.
Do you wish to enter another account? (Y/N) N
1. Gaye Deegan: gaye.deegan@unisa.edu.au
Thankyou.

Mailing List Manager
Enter a name: Ben Martini
Enter an email address: ben.martini@unisa.edu.au
Ben Martini at ben.martini@unisa.edu.au has been recorded.
Do you wish to enter another account? (Y/N) N
1. Gaye Deegan: gaye.deegan@unisa.edu.au
2. Ben Martini: ben.martini@unisa.edu.au
Thankyou.

Assignment Help, Programming Language Assignment Help
Tags: ,