"I have great news for you. Here are some exercises to reinforce your skills. Work on them every day, and your competence will grow exponentially. They were specially designed for IntelliJ IDEA."
while (true) {
// int number = read the number;
if (firstnum == -1 || secondnum == -1 || thirdnum == -1 || fourthnum == -1 || fifthnum == -1) {
System.out.println(firstnum + secondnum + thirdnum + fourthnum + fifthnum);
}
break;
}
I don't understand....The program is telling me to include -1 in the sum, but -1 was added in the sum. This was the input data:
-1
11
19
9
14
int b = 0;
while (true){
int a = Integer.parseInt(bb.readLine());
if (a<=-1){
b = b+a;
System.out.println(b);
break; }
b=b+a;
}
please cna i get help as to why this SAYS
Be sure that the program works correctly with negative numbers.
GO TO FULL VERSION