Question: For this question, we are going to use an idea known as parallel lists to store two different pieces of information. This isn't the best

For this question, we are going to use an idea known as "parallel lists" to store two different pieces of
information. This isn't the best way to implement what Im asking, but we haven't talked about the
data structures that would be better yet!
Create a class called SantasList that has two fields, both of which should be ArrayLists. The first list
should contain strings that are the names of children (don't worry about creating a separation
between first and last name). The second list should contain Boolean values, where true equates to
nice and false equates to naughty.
The class should include getters and setters for the two lists. Instead, include and implement
the following two functions:
J**
Adds a child's name and whether they were naughty or nice to the list
@postcond Iadds a child's name and nice-ness to the list]
*I
private static void addChild(String name, Boolean isNice)
and
/***
Prints each child's name, along with either "naughty" or "nice", followed by a new lin
e
@epostcond [On each line prints a child's name and nice-ness until the whole list has b
een printed]
*!
private static yoid printList()
For this question, we are going to use an idea

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!