1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zaharov [31]
4 years ago
6

Write a GUI program that calculates the average of what an employee earns in tips per hour. The program’s window should have Ent

ry (font: Courier New) widgets that let the user enter the number of hours they worked and amount they earned in tips during they time. When a Calculate button is clicked, the program should display the average amount they got paid in tips per hour. Use the following formula: Tips per hour = amount of tips in dollars / hours.
Computers and Technology
1 answer:
Luba_88 [7]4 years ago
4 0

Answer:

Explanation:

Using Code:

from tkinter import *

#object of Tk class to make GUI

root = Tk()

#creating a canvas to put labels, entries and button

canvas1 = Canvas(root, width = 300, tallness = 200)

canvas1.pack()

#label for number of hours worked

label1 = Label(root, text = "Hours : ", textual style = ('Courier', 10))

canvas1.create_window(80, 50, window = label1)

#entry for number of hours worked

entry1 = Entry(root, textual style = ('Courier', 10))

canvas1.create_window(200, 50, window = entry1)

#label for sum they earned in tips

label2 = Label(root, text = "Tips : ", textual style = ('Courier', 10))

canvas1.create_window(80, 80, window = label2)

#entry for sum they earned in tips

entry2 = Entry(root, text style = ('Courier', 10))

canvas1.create_window(200, 80, window = entry2)

#label for tips every hour

label3 = Label(root, text = "Tips Per Hour : ", textual style = ('Courier', 10))

canvas1.create_window(80, 150, window = label3)

#function to figure tips every hour

def TipsPerHour():

#getting estimation of hour

hours = int(entry1.get())

#getting estimation of tips

tips = int(entry2.get())

#calculating normal sum got paid in tips every hour

normal = tips/hours

#creating a name to show normal

label4 = Label(root, text = "$" + str(average), textual style = ('Courier', 10))

canvas1.create_window(170, 150, window = label4)

#button for compute

calculateButton = Button(root, text = "Compute", textual style = ('Courier', 10), order = TipsPerHour)

canvas1.create_window(170, 110, window = calculateButton)

#mainloop

root.mainloop()

You might be interested in
5. Which of the code excerpts below correctly links to an element with the id "awesome”.
Pachacha [2.7K]

Answer:

I think its click me

Explanation:

click me

6 0
3 years ago
Read 2 more answers
What type of switch connects users to the network?
SSSSS [86.1K]
A domain or asynchronous Ethernet.. I think its the first one though...
6 0
3 years ago
Hey! PLEASE HELP!!!
Solnce55 [7]

Answer:

change your computer date/skip the videos

Explanation:

hi there!  i've been using brainly for free for some time and found that there a few ways to bypass some of their free member restrictions.

first off, there's really not an easy way to skip the video, unless you want to get technical.  however, i've found that you can drag on the grey video bar on the bottom of the ad to skip to the very end, thus getting you the answer you need very quickly!

also, brainly has a 7 day answer restriction in place, which you can easily bypass by changing the date on your computer!  an easy way to do that is to hit the Windows key and type "date", after which a setting will pop up that reads "Date & time settings".  click on that or hit enter. then, tick off the slider that says "Set time automatically", and go down to "Set the date and time manually", after which you'll hit "Change" and change the day to a couple days in the future.  give it a second, refresh the brainly tab or re-search up your answer, and you should get a lot more daily answers!  one thing i must say about this method is that your computer's date will no longer be accurate. to fix this, you'll have to re-tick the slider that reads "Set time automatically", and it should fix your clock.

one more thing is that, instead of sending your parent an email, you can try to send yourself that email! unless it's an advertisement for buying brainly premium, there also should be no reason to even send the email in the first place, so try to bypass that when you can.

i hope this helps you!

4 0
3 years ago
Write a C11 program that prompts the user to input the elapsed time for an event in seconds. The program then outputs the elapse
torisob [31]

Answer:

Explanation:

#include <iostream>

using namespace std;

int main()

{

int secondsElapsed, hours, minutes, seconds;

const int secondsPerMinute = 60;

const int secondsPerHour = 60 * secondsPerMinute;

cout << "Please enter the number of seconds elapsed: ";

cin >> secondsElapsed;

hours = secondsElapsed / secondsPerHour;

secondsElapsed = secondsElapsed % secondsPerHour;

minutes = secondsElapsed / secondsPerMinute;

seconds = secondsElapsed % secondsPerMinute;

cout << hours << ":" << minutes << ":" << seconds << endl;

return 0;

}

7 0
4 years ago
Which of these strategies do you practice when tests are returned to you? Check all that apply.
victus00 [196]

Answer:

I apply numbers...

5, 6 and 3

7 0
3 years ago
Read 2 more answers
Other questions:
  • What is the name of the feature that can be enabled on slower-speed WAN links to prevent a large data transfer from affecting th
    10·1 answer
  • Question / UJU
    11·1 answer
  • python A pet shop wants to give a discount to its clients if they buy one or more pets. The discount is equal to 20 percent of t
    12·1 answer
  • Create the following matrix M: 1 7 13 19 25 ?-3 9 15 21 27 5 11 17 2329By writing one command and using the colon to address ran
    8·1 answer
  • 5. How would you describe the relationship between blocks of code and commands?​
    14·2 answers
  • Which of the following is a function of the slip yoke used on a driveshaft?
    14·1 answer
  • Write a program that teaches arithmetic to a young child. The program tests addition and subtraction. In level 1, it tests only
    11·1 answer
  • Which tool is used to see the wireless networks in a given area?
    5·1 answer
  • Es el nombre que se le da a la<br> intersección de una columna y fila:
    15·1 answer
  • See attached. I have code typed out but still having problems.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!