Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class domashnobonustochki {
  4. public static void main(String[] args) {
  5. Scanner console = new Scanner(System.in);
  6. int tochki = Integer.parseInt(console.nextLine());
  7. double bonustochki = 0;
  8. if (tochki <= 100) {
  9. bonustochki = 5;}
  10. else if (tochki < 1000){
  11. bonustochki = 0.2 * tochki;}
  12.  
  13. else if (tochki > 1000){
  14. bonustochki = 0.1 * tochki;
  15. }
  16. if (tochki % 2 == 0) {
  17. bonustochki +=1;}
  18. else if (tochki % 5 == 0){
  19. bonustochki +=2;
  20. }
  21. System.out.println(bonustochki);
  22. System.out.println(tochki + bonustochki);
  23.  
  24. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement