[10 / 1 / ?]
Quoted By:
How would I store the information from my code(see below) into a object? I'll be naming the object employees.
The code I have now executes thisplease tell me if there are any mistakes on the code I have so far)
1.Ask the user to enter payroll information for the company. Set up a loop that continues to ask for information until the user enters “DONE”. For each employee ask three questions:
name (first & last name together as a single response)
hours worked this week (only allow 1 through 60)
hourly wage (only allow 6.00 through 20.00)
***Now this is where I get confused on structure and so on:
2.Create an EMPLOYEE object that will store the name, hours worked, and hourly wage. After the 3 items of information have been entered for an employee, use a method of the EMPLOYEE object to print the name, hours worked, and hourly wage. Setup properties for the name, hourly wage, and hours worked. Create a method that will calculate the employee’s pay (as a private attribute). Create a property for the employee’s pay. Add to a list only the pay for each employee.
Weekly pay is calculated:
For (1-40 hours) it is hourly rate * hours worked
For (41-60 hours) it is (hours worked – 40) * (hourly rate * 1.5)
+ (hourly rate * 40)
The code I have now executes thisplease tell me if there are any mistakes on the code I have so far)
1.Ask the user to enter payroll information for the company. Set up a loop that continues to ask for information until the user enters “DONE”. For each employee ask three questions:
name (first & last name together as a single response)
hours worked this week (only allow 1 through 60)
hourly wage (only allow 6.00 through 20.00)
***Now this is where I get confused on structure and so on:
2.Create an EMPLOYEE object that will store the name, hours worked, and hourly wage. After the 3 items of information have been entered for an employee, use a method of the EMPLOYEE object to print the name, hours worked, and hourly wage. Setup properties for the name, hourly wage, and hours worked. Create a method that will calculate the employee’s pay (as a private attribute). Create a property for the employee’s pay. Add to a list only the pay for each employee.
Weekly pay is calculated:
For (1-40 hours) it is hourly rate * hours worked
For (41-60 hours) it is (hours worked – 40) * (hourly rate * 1.5)
+ (hourly rate * 40)