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
What statement would you use to print the phrase Hello, world and then start a new line?
tangare [24]

Answer:

Statement to print phrase "Hello, world" and then start a new line in java.

System.out.println("Hello, world");

Explanation:

In java, we use "System.out.println();" statement to print any string/phrase and then start a new line.The above line will print phrase "Hello, world" and then start a new line.

Implementation in java:

// class definition

class Main

{

// main method of the class

public static void main (String[] args)

{

// statement to print phrase and start new line

      System.out.println("Hello, world");  

} }

7 0
4 years ago
Consider the following code: x=random.randint (1, 100) The randint is a ____.​
Mrrafil [7]
Random integer, in this case betweeen 1 and 100
5 0
3 years ago
Why do you think a business would set the price of their product above the competition
Flauer [41]

because a business wants you to buy their product. Its like gas prices, when one gas price is lower than another stores, people tend to go to the one with the lower price.

6 0
3 years ago
Read 2 more answers
Next, Sue decides to embed a chart from Microsoft Word. She copies and pastes data from a table that she has already created in
antoniya [11.8K]

Answer:

Its D

Explanation:

On Edg

8 0
3 years ago
Summarize the features of several stand-alone operating systems ​
katen-ka-za [31]

Answer:

Stand-Alone Operating Systems •Microsoft Windows Mobile –Designed for smartphones and PDAs –Includes simplified versions of Windows programs –Supports handwriting recognition and voice recording –Supports synchronizing with corresponding programs on desktop computers

Explanation:

Stand-Alone Operating Systems •Microsoft Windows Mobile –Designed for smartphones and PDAs –Includes simplified versions of Windows programs –Supports handwriting recognition and voice recording –Supports synchronizing with corresponding programs on desktop computers

8 0
2 years ago
Other questions:
  • The underline format will underline ____.
    14·1 answer
  • If you are feeling fatigued or sleepy while driving _________________.
    13·2 answers
  • 2. Consider the two-dimensional array A: int A[][] = new int[100][100]; where A[0][0] is at location 200 in a paged memory syste
    11·1 answer
  • Sally thought of adding a new paragraph after the
    6·1 answer
  • Why do we use a design process?
    13·2 answers
  • Hey should I get a r()blox gift card if so what amount 5 dollars 10 or 100
    14·1 answer
  • AJ created a list, and he needs all of the numbers to be in order. Which Python function will allow him to organize his list num
    5·2 answers
  • Which kind of a person will you be if you prove to be accountable for your actions?
    14·1 answer
  • ________ has the ability to drag windows to the edges or corners of your screen and have them snap into place.
    12·1 answer
  • THIS IS TIMED PLS HURRY UP
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!