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
6.Which of the following statements illustrates a characteristic of a person's attitudes
OleMash [197]
They act like a filter for info a person receives
8 0
3 years ago
Read 2 more answers
Which hardware device should he consider upgrading in order to increase the system's storage space?
Mademuasel [1]
The hard drive because this is where all the information is stored.
7 0
4 years ago
Write a program that will read in a line of text and output the number of words in the line and the number of occurrences of eac
kherson [118]

Answer:

Here is the C++ program:

#include<iostream>  //to use input output functions

#include <algorithm>  //to use tolower() function

using namespace std;  //to identify objects like cin cout

int main() {  //start of main function

 string text;  // to hold text input

 cout<<"Enter a line of text: ";  // prompts user to enter a string

 getline(cin,text);  // reads the input string (text) from user

transform(text.begin(), text.end(), text.begin(), ::tolower);  //converts the text into lower case

 int letter[26] = {0}; //to hold the letters

 int i;  // used as a loop variable

 int words=0;  // to hold the count of words

 for(i = 0; i< text.size();i++){  // iterates through the text

 if(isalpha(text[i])&&(text[i+1]=='.'||text[i+1]==','||text[i+1]==' '))  //checks if the character at i-th index of text is a letter, and checks if i+1 index position of text is a period, comma or a space

 words++;  // adds 1 to the count of words

 if(isalpha(text[i]))  // if the character at the i-th index of text is a letter

 letter[text[i]-'a']++;  }  // counts the occurrences of each letter

 char j = text[text.size()-1];  // sets j to the last character of text

 if(j != '.' && j!= ' '&& j!=',' &&j!= '\0')  //if the last character is not a period or empty space  or comma or end of lone

 words++;  //add 1 to the count of words

 cout<<"Number of words: "<<words<<endl;  //display the number of words in the text

 for(i=0; i<26; i++)  {  //iterates 25 times

   if(letter[i]>0)  //if letter at index i is greater than 0

   cout<<(char)('a'+i)<<" : "<<letter[i]<<endl;  }} //displays each letters and its number of occurrences in the text

 

Explanation:

The program is explained in the attached document with an example.

7 0
4 years ago
Problem # 1 [End of chapter problem] The following character encoding is used in a data link protocol: A: 01100111 B: 11110011 F
Whitepunk [10]

Answer:

a) 00000100 01000111 11100011 11100000 01111110  

b) 01111110 01000111 11100011 11100000 11100000 11100000 01111110 01111110

c) 01111110 01000111 110100011 11100000 011111010 0111110  

Explanation:

5 0
3 years ago
A service that enables a customer to build and run their own applications but doesn't include extensive access to hardware and m
Musya8 [376]

There are a lot of computer apps. A service that enables a customer to build and run their own applications but doesn't include extensive access to hardware and middleware is PaaS.

<h3>What is PaaS?</h3>

This is known to be one that helps user to install and run their own application on any kind of vendor-supplied hardware and system software.

The Platform-as-a-Service, is said to be a cloud computing model that gives customers a full cloud platform such as hardware, software, and infrastructure that is used for creating, running, and handling applications.

Learn more about PaaS from

brainly.com/question/14364696

8 0
2 years ago
Other questions:
  • List seven basic internal components found in a computer tower
    13·1 answer
  • .All of the following are true with the respect to implicitinvocation except:
    8·1 answer
  • A dendrochronologist interprets:
    10·2 answers
  • 1. Write a recursive method to determine if a character is in a list of characters in O(logN) time. Mathematically prove (as we
    13·1 answer
  • How do you know where the home row of the keyboard is?
    14·2 answers
  • g Given the information below, answer each part of the question: Page Size: 4 KB a. How many bits are in the Page Offset
    11·1 answer
  • A Python keyword ______________.
    15·1 answer
  • what is the name of the program that enables the device and operating system to communicate with each other?
    7·1 answer
  • What type of software repairs or improves a larger application that is already installed on a system?
    9·2 answers
  • Why header files are needed in every c program ?expalin​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!