Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am working with python idle 2.7.9 and I am having issue creating a program to

ID: 3668948 • Letter: I

Question

I am working with python idle 2.7.9 and I am having issue creating a program to work with adafruit lcd. The program is to have the adafruit lcd work as a newpaper stand. The object is to have the left,right and down button to work as change. To start the display message comes up "Today's paper only 30 cents. If the left button is pressed a nickel is inserted, the right button is a dime and the down button is a quarter. The newspaper requires 30 cents to get a newspaper. If you enter 30 cents then your total is displayed and the door opens so that you can get a newspaper then enjoy your paper is displayed. If more than 30 cents is inserted then your total will be shown as well as how much change you get back then the "door" will open and again the message enjoy your paper is displayed. At the end it will go back to the message Today's paper only 30 cents.

Explanation / Answer

# cook your code here

from Tkinter import *

class App:

def __init__(self, master):

    frame = Frame(master)

    frame.pack()

  self.prompt = Label(frame, text="Today's paper only 30 cents")

    self.amount= Label(self, text="Enter amount:")

    self.entry = Entry(self);  

    self.prompt.pack(side=LEFT);

    self.entry.pack(side =RIGHT);

    self.button = Button(frame,

                         text="QUIT", fg="red",

                         command=frame.quit)

    self.button.pack(side=LEFT);

    self.slogan1 = Button(frame,

                         text="nickel",

                         command=self.write_nickel)

    self.slogan.pack(side=LEFT);

    self.button.pack(side=RIGHT);

    self.slogan2 = Button(frame,

                         text="dime",

                         command=self.write_dime)

  self.slogan.pack(side=Bottom);

    self.slogan3 = Button(frame,

                         text="quarter",

                         command=self.write_quarter)

    self.slogan.pack(side=RIGHT)

def write_nickel(self):

    print "Your entered nickel"

def write_dime(self):

    print "your entered dime"

def write_quarter(self):

    print "your entered quarter"

def entry(self):

      if(self.amount> 30):

          print 'Wait for change is counting ...'

      else

          print 'amount is less than 30 cents, Entry few more...

root = Tk()

app = App(root)

root.mainloop()

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote