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
Why is the lack of a sense of humor a serious limitation for AI?
sergejj [24]

Answer:

they arent made to Express emotion? can you be a little more specific with the question?

3 0
2 years ago
You have just read about a new security patch that has been made available for your Windows system, so you install the patch as
zhenek [66]

Answer:

A

Explanation:

The best action to take is to download and install the last good update; in that case, it will override the recent unstable update.

An update is not like a single program that can be add or remove from the control panel.

6 0
3 years ago
Suppose that a machine with a 5-stage pipeline uses branch prediction. 15% of the instructions for a given test program are bran
zhenek [66]

Answer:

solution attached below

Explanation:

3 0
3 years ago
What is a motherboard​
aleksandr82 [10.1K]

Answer:

A motherboard is the main printed circuit board in general-purpose computers and other expandable systems. It holds and allows communication between many of the crucial electronic components of a system

Explanation:

8 0
2 years ago
Research the disadvantages of the computer and explain them.​
lisabon 2012 [21]

Answer:

Too much sitting-affects the back and makes our muscles tight

Carpal tunnel and eye strain-moving your hand from your keyboard to a mouse and typing are all repetitive and can cause injuries

Short attention span and too much multitasking-As you use a computer and the Internet and get immediate answers to your questions and requests, you become accustomed to getting that quick dopamine fix. You can become easily frustrated when something doesn't work or is not answered in a timely matter.

3 0
3 years ago
Other questions:
  • It is generally safe to provide your social security number to
    7·2 answers
  • T is important to remember to print the return address when printing an
    5·1 answer
  • _____ remove the part of an image starting from an edge​
    13·1 answer
  • Once a virus has been removed by your anti-virus program, all traces of it are gone from your computer.
    9·1 answer
  • Cynthia realized that she used a wrong term throughout her paper. Which option can help her quickly correct her mistake?
    5·1 answer
  • Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter.
    14·1 answer
  • Which is the correct notation to specify the following inheritance?
    8·1 answer
  • 1.Which one of the following buttons returns a window to its original size?
    11·1 answer
  • Task 2
    6·1 answer
  • Write a loop that continually asks the user what pets the user has until the user enters stop, in which case the loop ends. It s
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!