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 | _____ |
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.