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]
4 years ago
7

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

Computers and Technology
1 answer:
levacccp [35]4 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
Samuel is working on decimal and binary conversion for his college project.He is using the binary number 111011 and wants to exp
Bond [772]

The answer would be to multiply the binary code with all results from the formula Samuel used to encode the desired number, until he gets 59 as a result.

(P.s. 111011 isn't 59, it results in a semicolon if you convert it using an binary code translator. It rather states that 00110101 00111001 is 59)

6 0
4 years ago
Consider this C Program C++ Program Java Program or C# Program. It reads integers from the
LiRa [457]

Answer:

yeah

Explanation:

Consider this C Program or Java Program or Python Program. It reads integers from the standard input (until it gets a negative number) and puts them into an array. After that it calls processArray on the array, and then prints the contents of the array on standard output.

Currently, processArray does not modify the array. You have to change this program so that any sequence of two or more consecutive numbers even numbers in the array are removed from the array and replaced with just the first number of the sequence. In other words, in any sequence of even numbers, only the first number is retained and the others are removed. The processArrayfunction/method should modify the array in-place (preferably without creating a new array), and it should return the new length of the modified array

4 0
3 years ago
"If possible, always bring print-outs of your slides for your audience
taurus [48]
Why do I need a ty for me a couple days to
4 0
3 years ago
Read 2 more answers
Please help me please
viktelen [127]

Answer:

what are the choices

Explanation:

6 0
4 years ago
. An operating system is: *
Artemon [7]

Answer:

3. System Software

Explanation:

An operating system is a special type of system software. It controls and co-ordinates overall of the computer.

4 0
3 years ago
Other questions:
  • Let's say you're creating a search stream in your hootsuite dashboard, to find mentions of the phrase vacation holiday getaway.
    15·1 answer
  • How would this requirement be implemented?
    12·1 answer
  • Harry wants to change the background of all of his presentation slides. Which slide will enable him to make this change to all t
    14·1 answer
  • How can touch typing quickly but accurately improve your earnings (the money you can make)
    15·2 answers
  • Worksheet titles and subtitles should be as wordy as possible.<br> a. True<br> b. False
    9·2 answers
  • A ? is the desired value where a process should be maintained. The value may be manually set, automatically set, or programmed.
    13·1 answer
  • Determine whether the phrase below is a sentence or a fragment.
    12·1 answer
  • I need help 50 points and brainiest if you answer
    10·2 answers
  • Adrian wants to run a digital movie clip that his friend shared with him through email. His system has 2 GB of RAM and 20 GB of
    9·1 answer
  • web analytics can tell you many things about your online performance, but what can analytics tools not tell you​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!