Advertisement
grodek118

Book Club Points

Sep 29th, 2022
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int books;
  10.         int points;
  11.  
  12.         System.out.println("How many books did you buy this month?");
  13.         books = scanner.nextInt();
  14.  
  15.         if (books >= 4)
  16.         {
  17.             points = 60;
  18.             System.out.println("You have " + points + " points");
  19.         }
  20.         else if (books == 3)
  21.         {
  22.             points = 30;
  23.             System.out.println("You have " + points + " points");
  24.         }
  25.         else if (books == 2)
  26.         {
  27.             points = 15;
  28.             System.out.println("You have " + points + " points");
  29.         }
  30.         else if (books == 1)
  31.         {
  32.             points = 5;
  33.             System.out.println("You have " + points + " points");
  34.         }
  35.         else
  36.         {
  37.             System.out.println("You didn't get any points");
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement