fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. System.out.println("Система расчёта штрафов");
  13.  
  14. int carSpeed = 31;
  15.  
  16. int fineFor1to10 = 20;
  17. int fineFor11to20 = 40;
  18. int fineFor21to30 = 60;
  19. int fineFor30andMore = 100;
  20.  
  21. int townSpeed = 50;
  22.  
  23. int overSpeed = carSpeed - townSpeed;
  24.  
  25. if(overSpeed < 20) {
  26. System.out.println("Скорость не превышена или превышена незначительно");
  27. }
  28. else if(overSpeed >= 1 && overSpeed < =10) {
  29. System.out.println("Штраф: " + fineFor1to10);
  30. }
  31. else if(overSpeed >= 11 && overSpeed < =20) {
  32. System.out.println("Штраф: " + fineFor11to20);
  33. }
  34. else if(overSpeed >= 21 && overSpeed < =30) {
  35. System.out.println("Штраф: " + fineFor21to30);
  36. }
  37. else if(overSpeed >= 30) {
  38. System.out.println("Штраф: " + fineFor30andMore);
  39. }
  40. }
  41. }
Compilation error #stdin compilation error #stdout 0.08s 47956KB
stdin
Standard input is empty
compilation info
Main.java:28: error: illegal start of expression
		else if(overSpeed >= 1 && overSpeed < =10) {
		                                      ^
Main.java:31: error: illegal start of expression
		else if(overSpeed >= 11 && overSpeed < =20) {
		                                       ^
Main.java:34: error: illegal start of expression
		else if(overSpeed >= 21 && overSpeed < =30) {
		                                       ^
3 errors
stdout
Standard output is empty