Inbox - public class Inbox cfw_ public static void...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Inbox { public static void main(String[] args) { EmailNode head = null; E while (true) { System.out.println("1. Receive e-mail (at beginning)"); System.out.println("2. Receive e-mail (at end)"); System.out.println("3. Delete first email (at top)"); System.out.println("4. Delete last email (at bottom)"); System.out.println("5. Delete email by its position"); System.out.println("6. Find and delete e-mail"); System.out.println("7. Sort by sender"); System.out.println("8. List emails"); System.out.println("9. Read email at a particular position"); System.out.println("10. How many emails do I have?"); S int choice = IO.readInt(); i if (choice == 1) { //input data for email from user / if (head == null) { head = new EmailNode(); head.data = /* data from user */; } else { EmailNode n1 = new EmailNode(); n1.data = /* data from user */; n1.next = head; head = n1; } } else if (choice == 2) { // input data for email from user String sender = IO.readString(); Email e = new Email(sender);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/03/2009 for the course CS 01-111 taught by Professor Pradiphari during the Fall '09 term at Rutgers.

Page1 / 3

Inbox - public class Inbox cfw_ public static void...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online