Consider the following declarations, designed to record the hours worked by the employees of a company through a given 14-day-long pay period (one fortnight), where each employee works on some subset of the days: #define FORTDAYS 14 #define MAX_EMPLOYEES 1000 typedef struct { int dd, mm, yyyy; double hours_worked; } workday_t; typedef struct { int emp_num; int ndaysworked; workday_t times[FORTDAYS]; double hourly_rate; } timecard_t; timecard_t this_fortnight[MAX_EMPLOYEES]; int num_employees;Which of the following statements is not consistent with the most likely intention of these definitions:Group of answer choicesIf a new employee starts working, then variable num_employees should increase by one, and the new person's emp_num can be any integer value that has not been assigned to another employeeVariable this_fortnight[k].ndaysworked is an integer that counts the number of days worked in the current fortnight by the employee whose employee number is given by this_fortnight[k].emp_num, provided k<num_employeesVariable num_employees should always be in the range from zero to MAX_EMPLOYEESEach instance of variable ndaysworked should always be in the range from zero to FORTDAYSIf a new employee starts working, their emp_num should be taken from the value of num_employees, and then num_employees should be increased by one, so that the employee numbers remain sorted in the array
Question
Consider the following declarations, designed to record the hours worked by the employees of a company through a given 14-day-long pay period (one fortnight), where each employee works on some subset of the days: #define FORTDAYS 14 #define MAX_EMPLOYEES 1000 typedef struct { int dd, mm, yyyy; double hours_worked; } workday_t; typedef struct { int emp_num; int ndaysworked; workday_t times[FORTDAYS]; double hourly_rate; } timecard_t; timecard_t this_fortnight[MAX_EMPLOYEES]; int num_employees;Which of the following statements is not consistent with the most likely intention of these definitions:Group of answer choicesIf a new employee starts working, then variable num_employees should increase by one, and the new person's emp_num can be any integer value that has not been assigned to another employeeVariable this_fortnight[k].ndaysworked is an integer that counts the number of days worked in the current fortnight by the employee whose employee number is given by this_fortnight[k].emp_num, provided k<num_employeesVariable num_employees should always be in the range from zero to MAX_EMPLOYEESEach instance of variable ndaysworked should always be in the range from zero to FORTDAYSIf a new employee starts working, their emp_num should be taken from the value of num_employees, and then num_employees should be increased by one, so that the employee numbers remain sorted in the array
Solution
The statement that is not consistent with the most likely intention of these definitions is: "If a new employee starts working, their emp_num should be taken from the value of num_employees, and then num_employees should be increased by one, so that the employee numbers remain sorted in the array."
This statement is inconsistent because the emp_num is not necessarily related to the num_employees. The emp_num can be any integer value that has not been assigned to another employee, as stated in the first statement. It does not have to be taken from the value of num_employees. Therefore, the employee numbers do not have to remain sorted in the array.
Similar Questions
Consider the following declarations, designed to record the hours worked by the employees of a company through a given 14-day-long pay period (one fortnight), where each employee works on some subset of the days: #define FORTDAYS 14 #define MAX_EMPLOYEES 1000 typedef struct { int dd, mm, yyyy; double hours_worked; } workday_t; typedef struct { int emp_num; int ndaysworked; workday_t times[FORTDAYS]; double hourly_rate; } timecard_t; timecard_t this_fortnight[MAX_EMPLOYEES]; int num_employees;Which of the following statements is not consistent with the most likely intention of these definitions:Group of answer choicesIf a new employee starts working, then variable num_employees should increase by one, and the new person's emp_num can be any integer value that has not been assigned to another employeeVariable this_fortnight[k].ndaysworked is an integer that counts the number of days worked in the current fortnight by the employee whose employee number is given by this_fortnight[k].emp_num, provided k<num_employeesVariable num_employees should always be in the range from zero to MAX_EMPLOYEESEach instance of variable ndaysworked should always be in the range from zero to FORTDAYSIf a new employee starts working, their emp_num should be taken from the value of num_employees, and then num_employees should be increased by one, so that the employee numbers remain sorted in the array
The National Labor Union can be credited with the implementation of the eight-hour workday.Group of answer choicesTrueFalse
_________ is the number of workdays or work hours required to complete a task.
A alone can complete a work in 16 days and B alone in 12 days. Starting with A, they work on alternate days. The total work will be completed in ______.A 12 days B 13 days C days D days
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
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.