Knowee
Questions
Features
Study Tools

With examples distinguish between the following terms as used in Event driven programming;i. Entity (2 marks)ii. File (2 marks)iii. Record (2 marks)iv. Table (2 marks)b) A program is required to determine the gross pay for each of the several employees of acertain company. The company pays “straight-time” for the first 40 hours worked by eachemployee and pays “one-and a half time” for all hours worked in excess of 40 hours. You aregiven a list of employees in the company, the number of hours each employee worked and thehourly rate of each employee. You are to design a program in which you should input thisinformation for each employee, and then compute and display the employee’s gross pay. use textboxes for both inputs and outputs.Required:i. Design the graphical user interface for this program (4 marks)ii. Write a program code to compute the gross pay. Your program should validate the inputsin such a way that the names of the employees must be input, the number of hoursworked and pay rate must be numeric, greater than zero but less than or equal to 60 andgreater than zero respectively. Display an appropriate message in case of violation

Question

With examples distinguish between the following terms as used in Event driven programming;i. Entity (2 marks)ii. File (2 marks)iii. Record (2 marks)iv. Table (2 marks)b) A program is required to determine the gross pay for each of the several employees of acertain company. The company pays “straight-time” for the first 40 hours worked by eachemployee and pays “one-and a half time” for all hours worked in excess of 40 hours. You aregiven a list of employees in the company, the number of hours each employee worked and thehourly rate of each employee. You are to design a program in which you should input thisinformation for each employee, and then compute and display the employee’s gross pay. use textboxes for both inputs and outputs.Required:i. Design the graphical user interface for this program (4 marks)ii. Write a program code to compute the gross pay. Your program should validate the inputsin such a way that the names of the employees must be input, the number of hoursworked and pay rate must be numeric, greater than zero but less than or equal to 60 andgreater than zero respectively. Display an appropriate message in case of violation

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

i. Entity: In event-driven programming, an entity is an object or component that can trigger or respond to events. For example, a button in a graphical user interface (GUI) can be an entity. When a user clicks the button, it triggers an event (button click event).

ii. File: A file in event-driven programming is a resource used to store data persistently. For example, a text file can be used to store user input or program output. Events can be triggered when a file is opened, data is written to or read from the file, or the file is closed.

iii. Record: A record in event-driven programming is a collection of related data treated as a single unit. For example, in a database, a record might contain data about a single customer, including fields for name, address, and phone number. An event might be triggered when a record is created, updated, or deleted.

iv. Table: A table in event-driven programming is a collection of records. For example, a database table might contain a list of customers. An event might be triggered when a new record is added to the table, a record in the table is updated, or a record is removed from the table.

b) i. Designing the graphical user interface for this program would require a tool like Visual Studio or another GUI design tool. The interface would need text boxes for employee name, hours worked, and pay rate, and a button to calculate gross pay. It would also need a text box to display the calculated gross pay.

ii. Here is a simple example of how the program code might look in Python:

def calculate_gross_pay(hours_worked, pay_rate):
    if hours_worked <= 40:
        return hours_worked * pay_rate
    else:
        return 40 * pay_rate + (hours_worked - 40) * pay_rate * 1.5

employee_name = input("Enter employee name: ")
hours_worked = float(input("Enter hours worked: "))
pay_rate = float(input("Enter pay rate: "))

if not employee_name or hours_worked <= 0 or hours_worked > 60 or pay_rate <= 0:
    print("Invalid input. Please try again.")
else:
    gross_pay = calculate_gross_pay(hours_worked, pay_rate)
    print(f"The gross pay for {employee_name} is {gross_pay}.")

This code first defines a function to calculate gross pay based on hours worked and pay rate. It then prompts the user to enter the employee name, hours worked, and pay rate. If any of these inputs are invalid, it displays an error message. Otherwise, it calculates the gross pay and displays it.

This problem has been solved

Similar Questions

A ________ is money you are paid based on the number of hours worked multiplied by the rate earned per hour.A.profitB.giftC.wageD.royaltySUBMITarrow_backPREVIOUS

You will be working with a table named job_data with the following columns:job_id: Unique identifier of jobsactor_id: Unique identifier of actorevent: The type of event (decision/skip/transfer).language: The Language of the contenttime_spent: Time spent to review the job in seconds.org: The Organization of the actords: The date in the format yyyy/mm/dd (stored as text).Tasks:Jobs Reviewed Over Time:Objective: Calculate the number of jobs reviewed per hour for each day in November 2020.Your Task: Write an SQL query to calculate the number of jobs reviewed per hour for each day in November 2020

It captures the time that individual workers spend on each production job.Select one:a.labor distribution summaryb.Personnel Action Formsc.time cardd.job ticket

Arun earns $81 for 4 hours of work. If he makes a constant hourly wage, which table represents the relationship between the number of hours he works and his total earnings?ATime, . , left parenthesis hours right parenthesisTime(hours) PayPay11 dollar sign, 20, point, 2, 5$20.251111 dollar sign, 30, point, 2, 5$30.252121 dollar sign, 40, point, 2, 5$40.25BTime, . , left parenthesis hours right parenthesisTime(hours) PayPay44 dollar sign, 81$8188 dollar sign, 85$851212 dollar sign, 89$89CTime, . , left parenthesis hours right parenthesisTime(hours) PayPay11 dollar sign, 20, point, 2, 5$20.2522 dollar sign, 21, point, 2, 5$21.2533 dollar sign, 22, point, 2, 5$22.25DTime, . , left parenthesis hours right parenthesisTime(hours) PayPay44 dollar sign, 81$8155 dollar sign, 101, point, 2, 5$101.2566 dollar sign, 121, point, 5, 0$121.50

An employee will have a name, pay_rate, and list of hours_worked.Employee class must have following methods:Constructor – takes name and pay_rate. It will also creat an empty list of hours_worked.add_hours – takes hours as a parameter and add it to the hours_worked list.salary – calculates the salary for the employe (pay_rate x total hours worked).

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.