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
lutik1710 [3]
4 years ago
9

Implement a function called myFilter that does the following: Takes a sequence of integers with values from 0 to 100 Remove all

multiples of 6 less than 42 Then square each number Finally, remove any resulting integer that is odd public class Problem2 { public static IEnumerable myFilter(IEnumerable input) { } } static void Main(string[] args)
Engineering
1 answer:
Aleks [24]4 years ago
6 0

Answer:

using System;

using System.Collections.Generic;

using System.Linq;

public class Problem1 {

public static IEnumerable < int > myFilter(IEnumerable < int > input) {

return input.Where((val, index) => {

//First remove all multiples of 6 less than 42

return !(val % 6 == 0 && val < 42);

}).Select((val, index) => {

//Then square each number

return val * val;

}).Where((val, index) => {

// Finally, remove any resulting integer that is odd

return !(val % 1 == 0);

});

}

public static void Main(string[] args) {

Random rnd = new Random(5);

//Takes a sequence of integers with values from 0 to 100

var listForProblem = Enumerable.Range(1, 100).Select(i => rnd.Next() % 101);

var answer = Problem1.myFilter(listForProblem);

foreach(int i in answer) {

Console.WriteLine(i);

}

}

}

Explanation:

The Problem 1 solution is explanatory enough.

Your problem 2 question is lacking details. However, i have written a code that sorts it.

You might be interested in
Do not use C++ pointers (this is not a topic of this course).
noname [10]

The program is an illustration of functions in C++

C++ functions are collection of named program statements that are executed when called

<h3>The C++ program</h3>

The program in C++, where comments are used to explain each action is as follows:

#include <iostream>

#include <cmath>

using namespace std;

//This defines the boolean method

bool isoscelesTriangleHeightAndArea(double base, double hypotenuse, double height, double area) {

   //This checks for invalid base and height

   if(base < 0 || hypotenuse < 0){

       return false;

   }

   //This returns true if base and height are valid

   return true;

}

//The main begins here

int main(){

   //This initializes the variables

   double base, hypotenuse, height, area;

   //This gets input for base and hypotenuse

   cout<<"Base: ";    cin>>base;

   cout<<"Hypotenuse: "; cin>>hypotenuse;

   //The calls the boolean method

   bool success = isoscelesTriangleHeightAndArea(base, hypotenuse, height, area);

   //If success is True

   while (success){

       //This calculates height

       height = sqrt(hypotenuse*hypotenuse - (base/2) * (base/2));

       //This calculates area

       area = 0.5 * base * height;

       //This prints height

       cout << "Triangle height is " << height << endl;

       //This prints area

       cout << "Triangle area is " << area << endl;

       //This gets input for base and hypotenuse

       cout<<"Base: ";    cin>>base;

       cout<<"Hypotenuse: "; cin>>hypotenuse;

       bool success = isoscelesTriangleHeightAndArea(base, hypotenuse, height, area);

   }

   cout << "Invalid Input!" << endl;

}

Read more about C++ programs at:

brainly.com/question/24833629

#SPJ1

4 0
2 years ago
Who is the worst clown in rouge linage
Lerok [7]
All of them
explanation:
you don’t need one
4 0
3 years ago
A motorist is driving his car at 60km/hr when he observes that a traffic light 250m ahead turns red. The traffic light is
Alecsey [184]

Explanation:

Okay soo-

Given-

u = 60 km/hr = 60×1000/3600=50/3 m/s

t = 20 s

s = 250 m

a = ?

v = ?

Solution -

Here, acceleration is uniform.

(a) According to 2nd kinematics equation,

s = ut + ½at^2

250 = 50/3 ×20 + 0.5×a×20×20

250-1000/3=200a

(750-1000)/3=200a

a = -250/(3×200)

a = -5/12

a = 0.4167 m/s^2

The required uniform acceleration of the car is 0.4167 m/s^2.

(b) According to 1st kinematics equation

v = u + at

v = 50/3 + (-5/12)×20

v = 50/3-25/3

v = 25/3

v = 8.33 m/s

The speed of the car as it passes the traffic light is 8.33 m/s.

Good luck!

5 0
3 years ago
Which term describes the action of a qubit that moves from superposition to 1 or 0 after measurement?
Mariana [72]

The term that describes the action of a qubit that moves from superposition to 1 or 0 after measurement is Collapse.

<h3>What is collapse?</h3>

Collapse is the process that lead to the movement of qubit from a a state of superposition to 1 or 0 after measurements which make it to remain in that state.

Therefore, The term that describes the action of a qubit that moves from superposition to 1 or 0 after measurement is Collapse.

Learn more about collapse below.

brainly.com/question/23532927

#SPJ1

4 0
2 years ago
At 3M, the "Pollution Prevention Pays" (3P) program has generated over 11,000 3P projects that eliminated more than two billion
VMariaS [17]

Answer:

Green Marketing

Explanation:

Green marketing is defined as marketing efforts designed to produce, promote, and reclaim environmentally sensitive products. It is one of the the different concepts of social responsibility.

8 0
3 years ago
Other questions:
  • 9) A construction company employs 2 sales engineers. Engineer 1 does the work in estimating cost for 70% of jobs bid by the comp
    11·1 answer
  • Describe each of the following terms in the context of Ajax: a) type-ahead b) edit-in-place c) partial page update d) asynchrono
    11·1 answer
  • 1. Implement the k-means clustering algorithm either in Java or Python. • The program should be executable with at least 3 param
    12·1 answer
  • I'm a grandma my Samuel needs to be tough in math what do I do
    10·2 answers
  • The following yield criteria are dependent on hydrostatic stress (a) Maximum distortion energy and maximum normal stress (b) Tre
    7·1 answer
  • Create a document that includes a constructor function named Company in the document head area. Include four properties in the C
    7·1 answer
  • Derive and sketch the electrical field E of doping concentrations And(x) are given by,
    14·1 answer
  • Método de Programación lineal utilizado para resolver problemas en teoría de redes?
    15·1 answer
  • The current through a particular circuit
    5·1 answer
  • an object of mass 2kg is released from a top of inclined plane 30° and height 6m. The coefficient of kinetic friction of the sur
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!