-5
I was using this solution based on a code from a friend: but we are uncertain about the outcome.
double h = 0;
double n = 4;
double s = 0;
double n1 = 36;
for (int i = 1; i <=n; i++) {
h = h + (double) 1/i;
}
for (int i = 1; i <=n1; i++) {
s = s - (double) 1/i;
}
double total;
total = h*s;
System.out.println("S: " + s);
System.out.println("H: " + h);
System.out.println("Valor total: " + total);
Thank you very much, I checked with my teacher, and he confirmed that it is a correct solution, I was breaking my head with this problem for quite some time, I had to resort to outside help. :)
– play that funky music