exercisesMarch1408

exercisesMarch1408 - Your Individual class should have a...

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

View Full Document Right Arrow Icon
COMP202 Instructor: Ladan Mahabadi March 14, 2008 Multiples: Write a program that creates an ArrayList of n randomly generated integers (where is a user-input value). Your program should then display the generated list to the user and prompt him to enter an integer x . Next, your program should remove any integers that are not multiples of x from the list and display the final list.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Multiples [continued] Now that you have an ArrayList of randomly generated multiples of x , remove duplications so that at the end there’s only one copy of each value.
Background image of page 2
Phone Book: Create an Individual class ( Individual.java ) with the following features: Each Individual has: a non-empty name, a primary phone number, an address (may be empty) and an email address (may be empty)
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Your Individual class should have a constructor that receives a name the sets all the other fields to zeros appropriately, proper get and set functions and a toString method that returns a string containing all the proper information about the user Now implement class PhoneBook (PhoneBook.java ) that only contains a main method. Inside the main method, create an ArrayList of Individuals and until the user quits, prompt for individuals information, create Individual objects and add them to the ArrayList . Phone Book [continued] Prompt the user with the following two options: Search for a specific entry Sort the phone book How would you implement the above features?...
View Full Document

Page1 / 5

exercisesMarch1408 - Your Individual class should have a...

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

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