Question 18
Not yet graded / 8 pts
The No Cash Diner only accepts credit and debit cards when customers
pay for their meal.
1. All debit card payments require a personal identification number (PIN).
2. A credit card payment greater than or equal to $100 requires a
signature.
3. A credit card payment less than $100 does not require any additional
input from the customer.
A debit card never requires a signature and a credit card never requires a
PIN.
Develop the logic for the diner's checkout terminal to ask the customer for
the right credential, i.e., PIN or signature, when paying.
Your logic must start by allowing the user to input the amount of the
payment.
Then allow the user to enter the type of card, \"credit\" or \"debit\". Based on
the rules noted above, and the values for the two inputs, specify an
appropriate if structure so that Input PIN or Input signature will be
executed, as appropriate for how the customer is paying and the amount
of the payment.
Ask for the PIN or signature only if it is required.
You must use the following variable names for the items indicated:
cardType card type
payment payment
PIN PIN
signature signature
You may express your logic using a flowchart or pseudocode. It's OK if
the flowchart doesn't execute - it will be graded based on the correctness
of the algorithm it specifies.