1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
BigorU [14]
3 years ago
7

Implement a function called merge that does the following in C#:

Computers and Technology
1 answer:
levacccp [35]3 years ago
8 0

Answer:

Check the explanation

Explanation:

using System;

using System.Collections.Generic;

using System.Linq;

public class Problem2

{

public static IEnumerable<int> merge (IEnumerable<int> input1, IEnumerable<int> input2, IEnumerable<int> input3)

{

IList<int> list = new List<int>();

foreach (int i in input1)

{

if(i%3==0 && ! list.Contains(i))

list.Add(i);

}

foreach (int i in input2)

{

if(i%3==0 && ! list.Contains(i))

list.Add(i);

}

foreach (int i in input3)

{

if(i%3==0 && ! list.Contains(i))

list.Add(i);

}

return list;

}

}

public class Problem2Demo{

static void Main (string[] args)

{

Random rnd = new Random ();

var list1 = Enumerable.Range (1, 10).Select (i => (rnd.Next () % 15) + 1);

var list2 = Enumerable.Range (1, 10).Select (i => (rnd.Next () % 15) + 1);

var list3 = Enumerable.Range (1, 10).Select (i => (rnd.Next () % 15) + 1);

var answer = Problem2.merge (list1, list2, list3);

foreach (int i in answer)

{

Console.WriteLine (i);

}

}

Kindly check the attached output image below.

You might be interested in
package dataStructures; /** * Class OrderedLinkedList. * * This class functions as a linked list, but ensures items are stored i
valkas [14]

Answer:

?

Explanation:

8 0
3 years ago
Where do you place the logical test argument in an JF function formula?
balandron [24]

Answer:

the first argument listed after IF

Explanation:

The Logical... argument in an IF function formula is always the first argument listed after IF.  And the second option is the value to be printed if the logical...argument is true, and if it is false then the value mentioned as third argument is assigned, or printed. And the logical...argument never comes before the IF function formula. Hence, the right option is the first argument.

7 0
3 years ago
Read 2 more answers
1. A cell is identified by its ........
earnstyle [38]
Answers:
1- cell address ( i think)
5 0
2 years ago
Describe some common types of charts.​
Mekhanik [1.2K]
Bar chart.
Pie chart.
Line chart.
4 0
3 years ago
Read 2 more answers
Jake is photographing his pet puppy. He wants to preview the image the camera will capture. What part of the camera that is insi
german

A. i think that is right

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which functions are performed by server-side code??​
    10·1 answer
  • A four year old laptop will not boot and presents error messages on the screen
    8·1 answer
  • What is a quick way to close the header or footer view in a microsoft word document?
    12·1 answer
  • Write the definition of a class Counter containing: An instance variable named counter of type int. An instance variable named l
    14·1 answer
  • In addition to using comments and track changes, you can also use the comparison feature for reviewing documents. In this activi
    11·1 answer
  • Two types of formulas in Excel, what are they? A. Complex and simple, B. General and currency, C. Logical and Boolean, D. Trig a
    15·1 answer
  • A _______ template is used to maintain consistency in terms of margins and page numbers .
    6·1 answer
  • I will give brainliest!!!
    13·1 answer
  • Please help this is a coding assignment I need help! (use python)
    12·1 answer
  • Is y0utube an example of unsupervised learning or supervised learning?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!