Question: Programming Part 2: Write a program in Java that takes the integer 1 billion (1,000,000,000) from the command line or from user input. Once the
Programming Part 2:
Write a program in Java that takes the integer 1 billion (1,000,000,000) from the command line or from user input. Once the data is input then the program should perform the following operations:
- Find incremental sum of all the numbers until and including 1,000,000,000
- Find incremental sum of all the even numbers until and including 1,000,000,000
- Display the sum of all the numbers until and including 1,000,000,000
- Displays the sum of all the even numbers until and including 1,000,000,000
- Calculates the following:
- sum of all the numbers in Step 1 / sum of all the numbers in Step 2
- Displays the result of above calculation
Analysis Part 2:
Analyze the time taken by the program to complete, e.g., review the usage of cores using Activity Monitor program in Ubuntu and find a way to monitor the time taken by the program to complete its execution.
Please do not forget to take a screenshot of the Activity Monitor.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
