Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project Objectives Decision - making with if , if - else, if - elif - . . Data validation ( and correction and use of

Project Objectives
Decision-making with if, if-else, if-elif-..
Data validation (and correction and use of default) for user input using a while loop.
Nicely formatted numbers using format() function.
Multiple input data sets (i.e., for multiple employees).
Inside-out incremental development of the program.
Use PyCharm IDE rather than IDLE.
Python Language Elements:
Follow python naming conventions for variables and constants.
Use good descriptive naming for variables/constants.
Top comment must include your name, project number, lab section, and brief project description.
Project Overview
The Drive Web company consists of three divisions denoted A, B, and C. Within each division are two subdivisions denoted by 1 and 2. Finally, each subdivision has three pay scales denoted by a, b, and c [Note the use of upper- and lower-case letters].
You are to write a program that will ask the user to input the first and last names of an employee, and then request the employment designation which is a three-character string with the first character one of A, B, and C; the second character is one of 1 and 2; and the third character is one of a, b, c. The user is to input these characters one at a time. Finally, the program should ask the user to enter the number of hours the employee worked during the week.
After obtaining the information above, the program should compute and report the information entered plus the total pay for the week for the employee. valid input should be checked during entry.
The total pay is the number of hours times the pay rate (determined by scale) up to 40 hours, and after 40, it is time and a half. The per hour pay rates are as follows:
Division A
Subdivision\Scale a b c
110.7512.5014.50
211.7514.5017.50
Division B
Subdivision\Scale a b c
113.0016.0018.50
215.0018.5022.00
Division C
Subdivision\Scale a b c
116.7518.5020.50
219.2525.0030.00
Stages of the Program
1. program gathers input data for ONE employee (without validating it), calculates the total pay and print it.(see below for exact format).
2. AFTER STAGE 1 WORKS CORRECTLY add data validation (see rules below) for the input gathering.
3. AFTER STAGE 2 WORKS CORRECTLY add looping so that the program can handle as many employees as the user provides. After handling one employee, the program asks whether the user wants to enter data for another employee then proceeds accordingly).(STAGE 3 VERSION OF THE PROGRAM IS THE ONE THAT YOU SHOULD SUBMIT TO GET THE FULL 100 POINTS).
Input (for 1 employee)
Use input() function with appropriate prompts to get the following information from the user: employee first name, employee last name, numbers of hours per week, employee classification: division, subdivision, and scale.
Variable Naming
Use appropriate variable names, following the Python Naming Conventions.
Input Validation (added in stage 2)
Employees division and subdivision values can ONLY be one of: A, B, C (or a, b, c).
o Before checking for validity, do 2 things to help the user by fixing certain things:
o Grab just the 0th char they entered (in case they type in Low) char0= input_str[0].
o Capitalize that first char (in case they entered a) cap_char = char0.upper().
o If its invalid, keep asking the user for a valid division/subdivision letter until they enter something correct.
o Each of the 3 division/subdivision values will have its own validation loop.
Number of hours must be a positive number (integer) thats >0
o If its invalid, keep asking the user for a valid number of hours until they enter something correct.
Input -Multiple Employees (added in stage 3)
After printing the report for one employee, ask the user if they wish to enter another employee (YES or NO).
o If they say YES (or Yes or yes or YEs or yeS or ...) or Y (or y), then go around the big loop again.
Use the 2 String methods to 1) grab just the 1st char and 2) capitalize it) to reduce the number of cases that need to be checked to just Y(so thatd include yup, yea, yo, yellow, ...)
o Any other response (like No/no/N/n/nope/naw/whatever/who cares/red/green/...) will be assumed to be a NO.
Program Control Structures
Use if-else, if-elif ... to determine the total pay each employee entered by the user

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

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions