Knowee
Questions
Features
Study Tools

a) 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.(8 marks

Question

a) 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.(8 marks

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

Solution

a) 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 can be an entity. When a user clicks the button, it triggers an event.

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

iii. Record: A record in event-driven programming is a collection of related data treated as a single unit. For example, in a database of employees, each employee could be a record that includes data fields like name, ID, and job title. An event could be triggered when a record is created, updated, read, or deleted.

iv. Table: A table in event-driven programming is a collection of records. For example, a database might have a table of employees. Each row in the table is a record, and each column is a data field. Events can be triggered when a table is created, updated, read, or deleted.

b) i. Designing a graphical user interface for this program would involve creating text boxes for employee name, hours worked, and pay rate, as well as a button to calculate gross pay and a display area for the result.

ii. Here is a simple pseudocode example for calculating gross pay:

function calculateGrossPay(name, hours, rate) {
  if (name is not empty and hours > 0 and hours <= 60 and rate > 0) {
    if (hours > 40) {
      return (40 * rate) + ((hours - 40) * rate * 1.5);
    } else {
      return hours * rate;
    }
  } else {
    display "Invalid input. Please check the values and try again.";
  }
}

This function first checks if the inputs are valid. If they are, it calculates the gross pay based on the given rules. If the inputs are not valid, it displays an error message.

This problem has been solved

Similar Questions

Your Answer correctList the following documents in the order in which they are used when recording indirect labor costs in job order costing, with the first document on top.Position 1 of 3 Time tickets correct toggle button unavailableTime ticketsPosition 2 of 3 Factory overhead ledger correct toggle button unavailableFactory overhead ledgerPosition 3 of 3 Allocated to specific jobs through factory overhead correct toggle button unavailableAllocated to specific jobs through factory overheadCorrect AnswerQuestionTime ticketsFactory overhead ledgerAllocated to specific jobs through factory overhead

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

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).

An accounting system is used to Blank______.Multiple choice question.record sales transactions and generate customer receiptsrecord and summarize accounting data into reportsdistribute a company's investments evenlygenerate employee wages and benefits

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.