Update 2024-03-27: Greatly expanded the "Samples" page and renamed it to "Glossary".
Update 2024-04-04: Added 5 million mid-2011 posts from the k47 post dump. Browse (mostly) them here.
Update 2024-04-07: Added ~400 October 2003 posts from 4chan.net. Browse them here.

Welcome to Oldfriend Archive, the official 4chan archive of the NSA. Hosting ~170M text-only 2003-2014 4chan posts (mostly 2006-2008).
[10 / 1 / ?]

python

No.17271785 View ViewReplyOriginalReport
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)