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 06:00
The width of a piece of rectangular land is 5m shorter rhan 1/3 of its length .find the width of the land if the length is 60m,150m.
Answers: 1
question
Computers and Technology, 23.06.2019 01:20
Me with this program in c++ ! computers represent color by combining sub-colors red, green, and blue (rgb). each sub-color's value can range from 0 to 255. thus (255, 0, 0) is bright red. (130, 0, 130) is a medium purple. (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (in other word, equal amounts of red, green, blue yield gray).given values for red, green, and blue, remove the gray part. ex: if the input is 130 50 130, the output is: 80 0 80. thus, find the smallest value, and then subtract it from all three values, thus removing the gray.
Answers: 3
question
Computers and Technology, 23.06.2019 18:50
Ais a picture icon that is a direct link to a file or folder
Answers: 1
question
Computers and Technology, 23.06.2019 21:40
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings. for each match, add one point to user_score. upon a mismatch, end the game. sample output with inputs: 'rrgbryybgy' 'rrgbbrybgy'
Answers: 3
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, 02.02.2021 06:50
question
Mathematics, 02.02.2021 06:50
question
Mathematics, 02.02.2021 06:50
question
Mathematics, 02.02.2021 06:50
Questions on the website: 13722360