Write the definition of a class named Employee to hold the data of the working hours of employees and their salaries in a company. The class includes the following private data members: • Name: to represent employee's name • ID: to represent employee's ID • NumberHours: an array of type integer of size 24 to save the number of hours worked by the employee during the days of the month. • Price: to represent the price per hour. Additionally, the class should include: • A constructor that takes three parameters to initialize the instance variables Name, ID and price and create the array NumberHours. • A method SetHours. The method should ask the user to enter the number of hours worked in each day (fill the array). • A method TotalAmount that returns the amount which should be paid by the company to the employee. If the total worked hours exceeds 150, the company should pay an additional bonus of 10% of the total amount. Thus, normal payment is calculated as = total number hours X price per hour. Whereas, for bonus, the payment is calculated as = 1.10 X total number hours X price per hour

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 1CP: In previous chapters, you have created programs for the Greenville Idol competition. Now create a...
icon
Related questions
Question

Write a java program: 

 

 

Write the definition of a class named Employee to hold the data of the working hours of employees and their salaries in a company. The class includes the following private data members: • Name: to represent employee's name • ID: to represent employee's ID • NumberHours: an array of type integer of size 24 to save the number of hours worked by the employee during the days of the month. • Price: to represent the price per hour. Additionally, the class should include: • A constructor that takes three parameters to initialize the instance variables Name, ID and price and create the array NumberHours. • A method SetHours. The method should ask the user to enter the number of hours worked in each day (fill the array). · A method TotalAmount that returns the amount which should be paid by the company to the employee. If the total worked hours exceeds 150, the company should pay an additional bonus of 10% of the total amount. Thus, normal payment is calculated as = total number hours X price per hour. Whereas, for bonus, the payment is calculated as = 1.10 X total number hours X price per hour

Write the definition of a class named Employee to hold the data of the working hours of employees and their salaries in a company.
The class includes the following private data members:
• Name: to represent employee's name
• ID: to represent employee's ID
• NumberHours: an array of type integer of size 24 to save the number of hours worked by the employee during the days of
the month.
• Price: to represent the price per hour.
Additionally, the class should include:
• A constructor that takes three parameters to initialize the instance variables Name, ID and price and create the array
NumberHours.
• A method SetHours. The method should ask the user to enter the number of hours worked in each day (fill the array).
• A method TotalAmount that returns the amount which should be paid by the company to the employee. If the total worked
hours exceeds 150, the company should pay an additional bonus of 10% of the total amount.
Thus, normal payment is calculated as = total number hours X price per hour.
Whereas, for bonus, the payment is calculated as = 1.10 X total number hours X price per hour
Transcribed Image Text:Write the definition of a class named Employee to hold the data of the working hours of employees and their salaries in a company. The class includes the following private data members: • Name: to represent employee's name • ID: to represent employee's ID • NumberHours: an array of type integer of size 24 to save the number of hours worked by the employee during the days of the month. • Price: to represent the price per hour. Additionally, the class should include: • A constructor that takes three parameters to initialize the instance variables Name, ID and price and create the array NumberHours. • A method SetHours. The method should ask the user to enter the number of hours worked in each day (fill the array). • A method TotalAmount that returns the amount which should be paid by the company to the employee. If the total worked hours exceeds 150, the company should pay an additional bonus of 10% of the total amount. Thus, normal payment is calculated as = total number hours X price per hour. Whereas, for bonus, the payment is calculated as = 1.10 X total number hours X price per hour
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Reference Types in Function
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning