Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int books;
- int points;
- System.out.println("How many books did you buy this month?");
- books = scanner.nextInt();
- if (books >= 4)
- {
- points = 60;
- System.out.println("You have " + points + " points");
- }
- else if (books == 3)
- {
- points = 30;
- System.out.println("You have " + points + " points");
- }
- else if (books == 2)
- {
- points = 15;
- System.out.println("You have " + points + " points");
- }
- else if (books == 1)
- {
- points = 5;
- System.out.println("You have " + points + " points");
- }
- else
- {
- System.out.println("You didn't get any points");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement