Question

I need help creating a code for the problem in Python.

Joes Automotive Joes Automotive performs the following routine maintenance services: Oil change-$30.00 . Lube job-$20.00 Ra

0 0
Add a comment Improve this question Transcribed image text
Answer #1

# If indentation is removed, see the code from here : http://collabedit.com/5bud2

from tkinter import *

from tkinter import messagebox

root = Tk()

root.title("Joe's Automative")

root.geometry('340x330+550+200')

root.resizable(0, 0)


def show_total(total):

tot_p = Label(f1, font=('arial', 12), text="Total Amount: ${}".format(total),

justify=LEFT, padx=20)

tot_p.grid(row=3, column=0)


def exit():

qExit = messagebox.askyesno("Login", "Do you want to exit?")

if qExit > 0:

root.destroy()

return


def total():

price_dict = {0: 30.00, 1: 20.00, 2: 40.00,

3: 100.00, 4: 35.00, 5: 200.00, 6: 20.00}

total = 0.0

for i in range(7):

if var[i].get():

total += price_dict[i]

show_total(total)


opt = Frame(root, height=10, width=150, bd=4)

opt.pack()

var = [IntVar() for i in range(7)]

Checkbutton(opt, text="Oil Change",

variable=var[0], onvalue=1, offvalue=0).pack()

Checkbutton(opt, text="Lube job", variable=var[1]).pack()

Checkbutton(opt, text="Radiator flush", variable=var[2]).pack()

Checkbutton(opt, text="Transmission flush", variable=var[3]).pack()

Checkbutton(opt, text="Inspection", variable=var[4]).pack()

Checkbutton(opt, text="Muffler replacement", variable=var[5]).pack()

Checkbutton(opt, text="Tire rotation", variable=var[6]).pack()


f1 = Frame(root, height=10, width=150, bd=4)

f1.pack()

f2 = Frame(root, height=10, width=150, bd=4, relief="raise")

f2.pack()

btnGo = Button(f2, text="Total", padx=3, pady=3, bd=2, fg="black", font=(

'arial', 10, 'bold'), width=14, height=1, command=total).grid(row=0,

column=0)

btnExit = Button(f2, text="Exit", padx=3, pady=3, bd=2, fg="black", font=(

'arial', 10, 'bold'), width=14, height=1, command=exit).grid(row=0,

column=1)

if __name__ == "__main__":

root.mainloop()

Add a comment
Know the answer?
Add Answer to:
I need help creating a code for the problem in Python. Joe's Automotive Joe's Automotive performs the following routine maintenance services: Oil change-$30.00 . Lube job-$20.00 Radiator flus...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Joe’s Automotive Joe’s Automotive performs the following routine maintenance services: • Oil chan...

    Need the answer in CSharp programming not java. Joe’s Automotive Joe’s Automotive performs the following routine maintenance services: • Oil change—$26.00 • Lube job—$18.00 • Radiator flush—$30.00 • Transmission flush—$80.00 • Inspection—$15.00 • Muffler replacement—$100.00 • Tire rotation—$20.00 Joe also performs other nonroutine services and charges for parts and labor ($20 per hour). Create an application that displays the total for a customer’s visit to Joe’s. The form should resemble the one shown in Figure 6-28 . Figure 6-28 Automotive...

  • Lab Chapter 12 Vinnie's Auto Shop performs the following routine maintenance services: • Oil change: $35.00...

    Lab Chapter 12 Vinnie's Auto Shop performs the following routine maintenance services: • Oil change: $35.00 • Lube job: $25 • Battery replacement: $80 • Tire rotation: $20 Vinnie also performs other nonroutine services and charges for parts and for labor ($60 per hour). Using JavaFX, create a GUI application that buttons for the above list of services and textfields/buttons for parts and labor. As the user selects buttons, a total amount is to be displayed Grading Criteria • Documentation...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT