subject

25.12.6: Total Network of Friends, Help pls Write a program that prints the total friends between two people.

You should create two sets, one for each person, and add friends (strings) to each set representing the friends of that person.

Then, fill in the totalFriends function that takes the two people as parameters and returns a new set that includes their total friends.

Print out the set of total friends

Hints
There are multiple ways you can do this. Not all of the hints apply to each method.

You can loop over the elements in a set like this:

for (item of your_set. elems()) {
println(item);
}
You can use the set methods union or intersect like this:

// returns the union of a and b
a. union(b);

// returns the intersection of a and b
a. intersect(b);

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
Dr. wisteria is a prominent chiropractor in the chicago area. she wants to provide a forum for her patients to discuss their health concerns and to seek and offer advice to other patients. which telecommunications tool is most appropriate for dr. wisteria's needs?
Answers: 3
question
Computers and Technology, 24.06.2019 03:30
Auniform resource locator (url) is a formatted string of text that web browsers, email applications, and other software programs use to identify a particular resource on the internet. true false
Answers: 2
question
Computers and Technology, 24.06.2019 11:00
These statements describe lists in presentation programs: a. bullets can be turned off and on. b. bullets cannot be turned off. c. bullet styles, colors, and sizes can be changed. d. lists don't have to use bullets or numbers. e. numbering styles, colors, and sizes can be changed. f. numbers can be turned off and on. g. numbers cannot be turned off. select all that apply
Answers: 2
question
Computers and Technology, 24.06.2019 18:00
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best-suited for this?
Answers: 1
You know the right answer?
25.12.6: Total Network of Friends, Help pls Write a program that prints the total friends between t...
Questions
question
Mathematics, 30.11.2021 21:50
question
Mathematics, 30.11.2021 21:50
Questions on the website: 13722359