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);
}
}
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.