It has been observed by management that some faculty member at the university demonstratesa lackadaisical attitude toward teaching. They seldom go to class yet at the end of each month they receive full salary. Management hasdecided that GHs200, 300, 400, and 500 will be deducted from a faculty’s salary if he/she offends once, twice, third time and forth time respectively in a month. This means that if a faculty member offends once in a month GHs200 will be deducted, if a faculty member offends twice in a month,GHs500 (i.e. 200+300) will be deducted, if a faculty member offends three times in a month GHs900(i.e. 200+300+400), will be deducted and if a faculty member offends four times in a month GHs1,400 (i.e. 200+300+400+500). Assuming all faculty members are ona flat salary rate of GHs 2000.a.Write a program to request for the names of four faculty members and number times he/she has absented him/herself from class. One of them should have absented him/herself once, another twice, another three times and another four times. b.Using function overloading, define four functions namely absent1, absent2, absent3 and absent4toperform the following. 1.absent1 should have two arguments (base salary and a variable X). declare an appropriatedatatype for X and initialize it to 200. Your function should return the base salary minus Xwhen called. 52.absent2 should have three arguments (base salary and two variables X and Y). declare an appropriate data type for X, Y, initialize X to 200 and Y to 300. Your function should return the base salary minus the sum of X and Y when called.3.absent3 should have four arguments (base salary and three variables X, Y and Z). declare an appropriate data type for X, Y, Z initialize X to 200, Y to 300 and Z to 400. Your function should return the base salary minus the sum of X, Y and Z when called.4.absent4should have five arguments (base salary and four variables X, Y, Z and K). declare an appropriate data type for X, Y, Z and K, initialize X to 200, Y to 300, Z to 400 and K to 500. Your function should return the base salary minus the sum of X, Y, Z and K when called c. Displayyour results  d. critically explainsthe logic behind the code

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

4It has been observed by management that some faculty member at the university demonstratesa lackadaisical attitude toward teaching. They seldom go to class yet at the end of each month they receive full salary. Management hasdecided that GHs200, 300, 400, and 500 will be deducted from a faculty’s salary if he/she offends once, twice, third time and forth time respectively in a month. This means that if a faculty member offends once in a month GHs200 will be deducted, if a faculty member offends twice in a month,GHs500 (i.e. 200+300) will be deducted, if a faculty member offends three times in a month GHs900(i.e. 200+300+400), will be deducted and if a faculty member offends four times in a month GHs1,400 (i.e. 200+300+400+500). Assuming all faculty members are ona flat salary rate of GHs 2000.a.Write a program to request for the names of four faculty members and number times he/she has absented him/herself from class.

One of them should have absented him/herself once, another twice, another three times and another four times.

b.Using function overloading, define four functions namely absent1, absent2, absent3 and absent4toperform the following. 1.absent1 should have two arguments (base salary and a variable X). declare an appropriatedatatype for X and initialize it to 200. Your function should return the base salary minus Xwhen called. 52.absent2 should have three arguments (base salary and two variables X and Y). declare an appropriate data type for X, Y, initialize X to 200 and Y to 300. Your function should return the base salary minus the sum of X and Y when called.3.absent3 should have four arguments (base salary and three variables X, Y and Z). declare an appropriate data type for X, Y, Z initialize X to 200, Y to 300 and Z to 400. Your function should return the base salary minus the sum of X, Y and Z when called.4.absent4should have five arguments (base salary and four variables X, Y, Z and K). declare an appropriate data type for X, Y, Z and K, initialize X to 200, Y to 300, Z to 400 and K to 500. Your function should return the base salary minus the sum of X, Y, Z and K when called

c. Displayyour results 

d. critically explainsthe logic behind the code

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Maintenance
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education