Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using System; using System.Threading; namespace ConsoleApplication1 { // Simple Threading Examples - 4 // Using Threads to find of the sum of numbers 0-100 class

image text in transcribed

using System; using System.Threading; namespace ConsoleApplication1 { // Simple Threading Examples - 4 // Using Threads to find of the sum of numbers 0-100 class Program { public static int[] anarray = { 2, 3, 12, 15, 0, 4, 7, 9, 2, 7 }; public static int sum = 0; static void myThreadMethod(object myarray) { // a[0] will be the threadid and a[1] will be the size of the numbers added int[] a = new int[2]; a = (int[])myarray; int threadid = a[0]; int size = a[1]; for (int i = threadid * size ; i  

I need this code to be in C# and please provide proof the code works correctly with screenshots of window console. The questions are in the picture and the sample code is below the picture.

1. Given the serial code that adds two vectors, convert the code into a parallel program and use it to find the surn of the elements of the array given in the code. Submit your code given the arrays int[l -t, 3, 1, 6, 8, 9, 10, 23, 13, 14, 14, 67, 89, 3A, 23, 69, 16, 55, 32, 33, 4 ,5 ,6 ,18 Ji int[] b _ { 1, 7,8,4,9,12, 10, 3, 1, 14, 7, 7, 9, 3, 3, 6, 11, 165, 2, 1, 14, 15, 8, 33 }; addsevery iten af the array ta the sum for (int 1-2: i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

How do you think supervisors will react to the proposed change?

Answered: 1 week ago