Looping Sums
Write a Java program that will print the following to the screen. A starting point will be provided to you in GitHub. Please read the comments in the GitHub files.
-
Using a loop, calculate and print out the sum of all integers from 1 to 100 (inclusive).
-
Using a loop, calculate and print out the sum of \(1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{100}\) using
float
. -
Using a loop, calculate and print out the sum of \(\frac{1}{100} + \frac{1}{99} + \cdots + \frac{1}{2} + 1\) using
float
.