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 dont 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 niceness to the list
I
private static void addChildString 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 niceness until the whole list has b
een printed
private static yoid printList
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
