Question: It needs to be written in C# language. In c# Write an application that calculates the sum of numbers from one to one billion (1-10
It needs to be written in C# language. In c#
Write an application that calculates the sum of numbers from one to one billion (1-10 ^ 9) using multi-threading to meet the following requirements. Duration is 4 hours.
Software Requirements: 1- The application will be written in C # language. It should run without errors when compiled from source code. (40p)
2- Check the accuracy of the result with the Gauss method. Hint-> [(n * (n + 1) / 2) (10p)
3- Print the time between the start and end of the program on the screen. Other times the results will be calculated with a separate variable that will not be summed up. (10p)
4- The program will use thread and will calculate the result repeatedly by dividing the collecting work together, starting with 1 thread and increasing one by one up to 16 threads, and will print the working time and the total result found on the screen for each thread count. Results will be in the sample output format stated below. (40p)
5- Working times will be reduced up to a certain thread value because more than one processor core is used. The times in the sample output are incorrect, specifically changed. (-30p)
6- The program output will be exactly as follows, although it is different from the times in the example below. Turkish characters will not be used. Order, Letter sizes, variable locations, spaces between etc. is important. (-30p)
Times can be change.
Sample Output is:
Gauss Method Result=500000000500000000
RESULT for the 1. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 2. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 3. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 4. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 5. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 6. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 7. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 8. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 9. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 10. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 11. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 12. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 13. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 14. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 15. thread=500000000500000000 Elapsed Time=0.132
RESULT for the 16 thread=500000000500000000 Elapsed Time=0.132
Total Elapsed Time=0.132
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
