Please enable JavaScript to use CodeHS

Mail Forwarding

In this program, students will use a linked list to keep track of users' most recent email address. They create a system that allows a user to verify using any existing email and then providing the most current email.

Hard

6 Hours

High School

Project Description

Background

Your school graduating class has elected you most likely to keep in touch and to help live up to this title, you have decided to create an email forwarding website.


The way the website will work is that it will start with everyone’s school email address. From there, students can add and remove additional addresses. Anytime a person may want to contact another student, they can find the most recent email address by listing the person’s name and any of their currently valid email addresses. If a valid name and email address are found, the system will display the most current email address.


For example:

Let’s say that Maria Gordon’s original school email address is Maria.Gordon@harrdrockhigh.edu. She then adds a new email, maria@example.com. Next year she also decided to add maria@gmail.com, but removes her original school address, Maria.Gordon@harrdrockhigh.edu.


Maria’s high school friend Julie now wants to get in touch, so she enters Maria’s name and her school email address, but since Maria removed her school email address, the system will not provide Maria’s current email.


Let’s say that another one of Maria’s friends, Gordon, also wants to get in touch. He doesn’t have Maria’s current email, but does have her maria@example.com email address. In this case, the system will tell Gordon that Maria’s current email is maria@gmail.com since he did have a valid email in the system.


Your Task

You are going to build this project out in a few steps. The first step will be to create and test the structure to hold the information. You are going to use two data structures for this project: a Linked List and a Map. The map key is going to be the person’s full name and the value is going to be the head of the linked list.


In second part, you are going to add the other two utilities: removing an email and finding the forwarding address. The remove email should take a name and email address and remove that email from the name. The forwarding address will also take a name and email address and either return the current email address to forward mail to, or print out that the email is not found.


In the final part, you are going to add the user interface, including importing your starting names and email addresses.


After importing, you should print a menu that allows for users to do 1 of 4 things:
1 - Add a new email address
2 - Remove an email address
3 - Find forwarding information
4 - Exit


Based on their responses, you should prompt for a name and email, then complete the operation.

Project Demo

Explore this program before assigning it!

Project Overview

Here is an outline of the project activities: