Write a complete program (actually complete the one on the exam) which computes the following sum: ( 100 / 1 ) + ( 99 / 2 ) + ( 98 / 3 ) + ( 97 / 4 ) + ... + ( 3 / 98 ) + ( 2 / 99 ) + ( 1 / 100 ) Use a FOR loop in your program (where indicated) to compute the answer. Display the result with 3 decimal places. Hint: Use printf not println.
Here's what I have right now and I can't find out what's wrong with it?
import java.util.Scanner;
public class oneontheexam {
public static void main(String [] args) {
double sum = 0;
for (int i = 1; i<=100; i++)
sum += (100.0 - i + 1) / 1;
}
}