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
How to copy music from windows media player to pc?
Delvig [45]
<span><span>Click the playlist you want to export, and then click Export Playlist to File on the File menu.
</span><span>In the Save As dialog box, click the folder that contains the playlist you want to export.
</span><span>In the File name box, type a descriptive name for your playlist, and then click OK. This file is saved with a .asx file extension.</span></span>
4 0
3 years ago
When writing research questions, use action words, such as
irina1246 [14]

Answer: Effect

Explanation:

Research questions are demonstrated as the questions that directs or specifies the dimension of the research for a particular work and helps to determine the objectives of the paper or essay.

As per the question, while writing or farming research questions, action verb like 'effect' must be used as it would help determine the impact of a particular research question on the content and efficacy of the research and thus, frame questions that propose a clear, concise, intricate, and debatable thesis statement and offer an effective dimension to the essay that creates a valid impact on the audience.

6 0
3 years ago
Read 2 more answers
Suppose you have the following declaration.char[] nameList = new char[100];Which of the following range is valid for the index o
VMariaS [17]

4. Only (ii)

<u>Explanation:</u>

The declaration of the array can be of two types:

1. int a[100];

2. int[] a = new int[100];

The general thing about an array is that whenever we want to undergo traversal in an array, we always have to start from the 0th position as the size of the array may be a whole number (let us say 10). So, to undergo traversal in an array, we start from 0 to n-1 (in this case 9) such that it covers the size of the array.

The size of an array can be finite or infinite. The general rule is it starts from 0 to n-1 where n is the size of the array. In the above example, the range of the index of the array will be 0 through 100 and not 1 through 100.

4 0
3 years ago
What do you mean by real time system? Why real time system needs to response within limited time?
Anna11 [10]

Real time system means that the system is subjected to real time, i.e., response should be guaranteed within a specified timing constraint or system should meet the specified deadline. For example: flight control system, real time monitors etc.

4 0
3 years ago
Which of the following resources is an example of a web-based application?
kompoz [17]
The answer will be google docs since it depends on a web and its an application. hope it helps

3 0
3 years ago
Other questions:
  • Array A is not a heap. Clearly explain why does above tree not a heap? b) Using build heap procedure discussed in the class, con
    15·1 answer
  • Two technicians are discussing the voltage measurements taken on the circuit below: V1 = 12Volts; V2 = 12Volts; V3 = 0Volts; V4
    11·1 answer
  • Need help writing a program that reads a string if the option "E" (enter a string) is chosen, and checks if parentheses (), brac
    14·1 answer
  • A network monitor records the following information while recording a network connection.
    9·1 answer
  • What command is most effective at identifying different types of files?
    6·1 answer
  • What is a traditional tool used to align and mark vertical points from top to bottom?
    10·1 answer
  • What makes these Pokémon special?
    9·2 answers
  • Write a couple of paragraphs about the usefulness of computer​
    5·1 answer
  • David plays racing games on his way to work. He uses the analog stick to navigate his vehicle through other artificial intellige
    7·2 answers
  • What is the different sheets in excel
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!