Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

  1. Find incremental sum of all the numbers until and including 1,000,000,000
  2. Find incremental sum of all the even numbers until and including 1,000,000,000
  3. Display the sum of all the numbers until and including 1,000,000,000
  4. Displays the sum of all the even numbers until and including 1,000,000,000
  5. Calculates the following:
    • sum of all the numbers in Step 1 / sum of all the numbers in Step 2
  6. 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

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

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

6. How would you design your ideal position?

Answered: 1 week ago