Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are requested to design a system for Point of Sales. Design the interface similar to the one below: Add codes in the Compute button

You are requested to design a system for Point of Sales.

Design the interface similar to the one below: Add codes in the Compute button that will do the following:

image text in transcribed

a. Compute for bill. The bill is the product of number of orders and the price.

b. Compute for the discount. Discount is based on the payment option. If payment option is cash, discount is 6% of the bill, otherwise it is 2% of the bill.

c. Compute for the special discount. If the gender is Female, special discount is 15% of the bill, otherwise it is 7% of the bill.

d. Display the computed values in the corresponding textboxes

-------------

Could you help me to complete my answer please;

from tkinter import* m=Tk() m.title('Scenario3') name=StringVar() order=StringVar() price=StringVar() dis=StringVar() c=StringVar() sp=StringVar() bil=StringVar()

Label(m, text="Enter name ").grid(row=0,column=0) Entry(m,textvariable=name).grid(row=0,column=1)

Label(m,text="Select gender:").grid(row=1,column=0) Radiobutton(m, text="Male",variable=m,value=1).grid(row=2,column=0) Radiobutton(m, text="Female",variable=m,value=2).grid(row=2,column=1)

Label(m,text="Select payment option").grid(row=3,column=0) Radiobutton(m, text="Cash",variable=c,value=3).grid(row=4,column=0) Radiobutton(m, text="Card",variable=c,value=4).grid(row=4,column=1)

Label(m,text="Enter number of order").grid(row=5,column=0) Entry(m,textvariable=order).grid(row=5,column=1)

Label(m,text="Enter price").grid(row=6,column=0) Entry(m,textvariable=price).grid(row=6,column=1)

def com(): n=float(order.get()) pr=float(price.get()) bill=n*pr po=float(c.get()) if (po==3): d=(6/100)*bill else: d=(2/100)*bill g=float(m.get()) if (g==1): sd=(15/100)*bill else: sd=(7/100)*bill Button(m,text='Compute',command=com).grid(row=7,column=0)

Label(m,text="Discount").grid(row=8,column=0) a=Entry(m,textvariable=dis).grid(row=8,column=1)

Label(m,text="Special Discount").grid(row=9,column=0) b=Entry(m,textvariable=sp).grid(row=9,column=1)

Label(m,text="Bill").grid(row=10,column=0) c=Entry(m,textvariable=bil).grid(row=10,column=1)

mainloop()

Scenario3 Enter name Select gender: CMaleCFemale Select payment option: C Cash C Card Enter number of orders \begin{tabular}{c|c} Enter price & \\ \hline Compute & \\ \hline Discount & \\ Special Discount & \\ Bill & \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Data Analysis In Microsoft Excel

Authors: Alex Holloway

1st Edition

B0CCCPKTTX, 979-8852388452

Students also viewed these Databases questions