Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help for my python 3.5.2 version assignment. Directions: Define and call main. Add comments at the top to explain your program and use

I need help for my python 3.5.2 version assignment.

Directions:

Define and call main. Add comments at the top to explain your program and use meaningful variable names.

Create a program that will allow the user to enter in payroll data including first name, last name, hours worked, and pay rate. You will need to declare an empty list to store each of these data sets.

Get this data from your user using meaningful prompts. Make sure you use an appropriate typecast for numerical data, but typecasting is not needed for string data since input from the keyboard comes in as a string by default.

Add a while loop that lets the user press enter for the first name if they wish to quit entering data.

At this point, if you printed out the first element in each list, you would have data that looks like the following: Joe Smith 40 10

Add a loop that will print out all the data for each individual. HINT: The subscripts for the elements you print on a single line will all be the same!

Add a function that will calculate and return the total pay. You do not need to store total pay in a list. Just call the function from within the loop either before the print statement or within the print statement. Display the pay amount using a preceeding $ and two decimal points. You should now have something like this: Joe Smith 40 10 $400.00

Force the input for the employee's name to all caps. It is also important to use field widths and align financial data to the right. You should now have something like this:

JOE SMITH 40 10 $400.00

It is important that you strip the data of all preceeding and following spaces (white space) which can effect string data. Do this for all the data that has a data type of string. Test by adding a couple preceding and following spaces to all the data you input. If done correctly, the display will have only one space between each piece of data and there will be no error messages.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems Uropean Conference Adbis 2020 Lyon France August 25 27 2020 Proceedings Lncs 12245

Authors: Jerome Darmont ,Boris Novikov ,Robert Wrembel

1st Edition

3030548317, 978-3030548315

More Books

Students also viewed these Databases questions