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, 23.06.2019 09:00
The first screen you see when you open word2016 what is called?
Answers: 1
question
Computers and Technology, 23.06.2019 20:50
3.11.3 quiz: comparing and analyzing function typesquestion 4 of 102 pointswhat can you say about the y-values of the two functions f(x) = 3x2-3 andg(x)=2* - 3?
Answers: 2
question
Computers and Technology, 23.06.2019 22:20
What is a programming method that provides for interactive modules to a website?
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
What social factors affect your health
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, 10.06.2020 23:57
question
Spanish, 10.06.2020 23:57
question
Mathematics, 10.06.2020 23:57
question
Mathematics, 10.06.2020 23:57
question
Mathematics, 10.06.2020 23:57
question
Mathematics, 10.06.2020 23:57
question
Mathematics, 10.06.2020 23:57