Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify your code from the previous part so that once the customer finishes selection from the menu and sees the receipt, they are presented with

Modify your code from the previous part so that once the customer finishes selection from the menu and sees the receipt, they are presented with one final menu. This menu should allow the customer to select the pay options. Their choices should be:

(a) Cash

(b) One time pay card

Again, the user should make their selection by entering the corresponding number, and bad selections should cause the menu to repeat. If customer chooses Cash it should print that payment is completed and program should terminate. If the choice is One time pay card then your program asks for 4-digit card number and displays the invoice as follows (see the sample output) and terminates.

Note:

To display the sample 4-digit number 2345 as xx45 you must not use any string processing functions. Instead, you should use arithmetic operators that we covered in class.

Sample output:

it first prints similar content as shown before and then

How would you like to pay? Select one from the following menu.

(a) Cash

(b) Prepaid Card

> a

Thank you for your payment. Have a nice day!

Sample output:

it first prints similar content as shown before and then

How would you like to pay? Select one from the following menu.

(a) Cash

(b) Prepaid Card

> b

Enter 4 digit card number: 2345

You have paid by xx45. Have a nice day!

Some considerations:

Your output should be neatly formatted.

You cannot assume the user enters good input. That is, they may enter non-integer values and integer values outside the acceptable range. Your program must handle these issues by printing an appropriate error message and repeating the menu until a proper value is entered.

use python

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions