Positive number

  • 4
  • Locked
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.
You can't complete this task, because you're not signed in.
Comments (31)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Anonymous #11303271
Level 6 , Fuzhou, China
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);
Level 9 , Milan, Italy
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 😭😭😭
Level 1 , Koxhausen, Germany
8 September 2021, 03:14
I did it with 3 if statements
Level 5 , Wyken, United Kingdom
17 February 2021, 11:43
just add 1 to a variable, every time u enter a positive number
Level 9 , Milan, Italy
21 October 2022, 15:20
can you explain me?
Level 14 , Colombia
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
Jurabek Kuralbaev
Level 8 , Tashkent, Uzbekistan
8 July 2020, 10:03
Can anyone help me with this?! I did it right, result gives me task requirments are not met!
Tom Alexander
Level 15 , Bristol, United Kingdom
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.
Level 14 , United Kingdom
4 May 2020, 15:20
I completed the task using 8 conditional statements... Is there no simpler solution to solve the task?
Level 13 , Den Haag, Netherlands
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?
Geoff Green
Level 10 , Calgary, Canada
29 January 2020, 05:09
Don't forget the task wants positive numbers, not even numbers ;-)
Level 41
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?
Geoff Green
Level 10 , Calgary, Canada
23 February 2020, 22:40
My mistake, confusing even for positive numbers lol.
Tauqeer Arif
Level 7 , Jhelum, Pakistan
28 September 2019, 08:23
Why tired condition failing for me??
Level 8 , Chennai, India
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.