At the "Optimist" school, the scale used to assess knowledge has neither an upper nor lower bound. This pleases young gifted people (wouldn't you be happy to receive a score of a bazillion for a presentation?). All scores above zero are considered good. Scores below zero are bad. Students must pass final exams in three subjects. We need to enter three scores from the keyboard, and display the number of positive scores.
Positive number
- 4
Locked
Comments (31)
- Popular
- New
- Old
You must be signed in to leave a comment
Anonymous #11303271
30 March, 08:01
My answer is:
if(a>0){
i=i+1;
}if(b>0){
i=i+1;
}if(c>0){
i=i+1;
}
System.out.println(i);
0
furius72
21 October 2022, 15:12
i can tryed to find a boolean method positive/negative but I could not do it, so i write 8 if 😭😭😭
0
RUBEN CABRERAExpert
8 September 2021, 03:14
I did it with 3 if statements
0
KARMA GURUNG
17 February 2021, 11:43
just add 1 to a variable, every time u enter a positive number
+1
furius72
21 October 2022, 15:20
can you explain me?
0
Ozkin
5 November 2022, 01:23
dont use else if only use if, and use a variable count, this variable add 1 if the Boolean is true or false
+2
Jurabek Kuralbaev
8 July 2020, 10:03
Can anyone help me with this?!
I did it right, result gives me task requirments are not met!
+1
Tom Alexander
2 July 2020, 13:45
I completed this task using 8 if/ if else statements. Definitely not the most efficient method, but this was the only way that I could achieve it using my rudimentary Java knowledge.
+2
monipuff
4 May 2020, 15:20
I completed the task using 8 conditional statements... Is there no simpler solution to solve the task?
+2
peter
12 August 2020, 22:40
yeah im sure i can easily solve it that way but i when i dont know why this doesn't work than what did i really learn?
0
Geoff Green
29 January 2020, 05:09
Don't forget the task wants positive numbers, not even numbers ;-)
+1
Roman
31 January 2020, 08:13
0 - not a positive number
1 - a positive number
2 - a positive number
Display the number of positive numbers
number of positive numbers is 2
what's wrong?
+1
Geoff Green
23 February 2020, 22:40
My mistake, confusing even for positive numbers lol.
+1
Tauqeer Arif
28 September 2019, 08:23
Why tired condition failing for me??
+1
MATHI KRISHNAN
14 September 2019, 11:20
Hello,
The 3rd condition is failing for me.
Please help.
"The program should display the number of positive numbers in the original set."
Thanks.
0