Question: Inside of the class, Asg1Part2, write a main method that computes the sum of the numbers from 1 to 100. Print that sum with a

  1. Inside of the class, Asg1Part2, write a main method that computes the sum of the numbers from 1 to 100. Print that sum with a message.
  2. Run the main method (run class Asg1Part2). Check that the output is correct.
  3. Inside of class Asg1Part2, add additional code to the main method to ALSO compute the sum of the numbers from 1 to 2000 that are evenly divisible by 13. Print that sum with a message.
  4. Run the class Asg1Part2 (main method in that class). Check that the output is correct.
  5. Add more code to the main method in class Asg1Part2, to compute the "sum of the squares" of all the numbers from 1 to 50, i.e. 1*1 + 2*2 + 3*3 + ... +50*50. Print the sum with a message. (note, do not print a running sum, just the final sum).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!