I am getting the following when I try to get this code verified:
"Be sure that the program calculates the amount correctly."
When I run my program everything seems to match the conditions set by the instructor and everything calculates correctly...How do I get more information on what is needed here.
Regards Vince
package com.codegym.task.task04.task0442;
/*
Adding
*/
import java.io.*;
public class Solution {
public static int calculate = 0;
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int calcEntry = 0;
while( calcEntry != -1 ) {
String val = reader.readLine();
calcEntry = Integer.valueOf(val);
calculate = calculate + calcEntry;
if( calcEntry == -1 )
System.out.println(calculate);
}
}
}