Problem

The following program is used in a bookstore to determine how many discount coupons a cust...

The following program is used in a bookstore to determine how many discount coupons a customer gets. Complete the table that appears after the program.

import javax.swing.JOptionPane;public class CheckPoint{public static void main(String[] args){ int books, coupons; String input; input = JOptionPane.showInputDialog("How many books " + "are being purchased? "); books = Integer.parseInt(input); if (books<1) coupons = 0; else if (books<3) coupons = 1; else if (books<5) coupons = 2; else coupons = 3; JOptionPane.showMessageDialog(null, "The number of coupons to give is " + coupons); System.exit(0);}}

If the customer purchases this many books ...

this many coupons are given.

1

_____

2

_____

3

_____

4

_____

5

_____

10

_____

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT