import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
Scanner scanner = new Scanner(System.in);
System.out.println("enter a number");
float num = scanner.nextFloat();
float min = num % 5;
if (min>=0.0 && min <3.0 ){
System.out.println("green");
}
if (min>=3.0 && min <4.0 ){
System.out.println("yellow");
}
if (min>=4.0 && min <5.0 ){
System.out.println("red");
}
}
}
Number of days in the year
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
6 June 2019, 23:19
don't know... what is the task conditions? What part are you failing? We can't answer if you don't share this information. Don't copy and paste code. If you need help, go back to the task and hit the help button above the task, ask any question you have and use the slider to share your code.
.
.
![]()

0
Carrie Peng
2 June 2019, 23:11
what's wrong with my code. couldn't pass it. appreciate
0