Question

Create a single list that contains the following collection of data in the order provided: [1121,...

  1. Create a single list that contains the following collection of data in the order provided:

    [1121, "Jackie Grainger", 22.22,

    1122, "Jignesh Thrakkar", 25.25,

    1127, "Dion Green", 28.75, False,

    24.32, 1132, "Jacob Gerber",

    "Sarah Sanderson", 23.45, 1137, True,

    "Brandon Heck", 1138, 25.84, True,

    1152, "David Toma", 22.65,

    23.75, 1157, "Charles King", False,

    "Jackie Grainger", 1121, 22.22, False,

    22.65, 1152, "David Toma"]


    The data above represents employee information exported from an Excel spreadsheet. Whomever typed the data in originally didn't give much care to how the information was formatted, unfortunately. Each line of data has in it employee information (the whole number), the name of the employee (the string), and the employee's hourly wage (the decimal number). Some rows have extra information in them from a column in the spreadsheet that no one can remember what its purpose was.

    Note that the presence of a couple of new data types in the above - "float" values (the numbers with the decimals in them) and "bool" [short for boolean] values (True and False).
  2. Assume that the above information is a small sample of the company's data. Programmatically sort the information into three different lists: one for employee numbers, one for employee names, and one for employee salary information.
  3. No duplicate data should make its way into the new lists.
  4. For each value in the list containing hourly wage information, multiply the current value by 1.3 (since benefits are about 30% of a person's salary) and store each value in a list called total_hourly_rate. Programmatically determine the maximum value in the list and if it's over over 37.30, throw a warning message that someone's salary may be a budget concern.
  5. Determine if anyone's total hourly rate is between 28.15 and 30.65. If they are, add the hourly rate a new list called underpaid_salaries.
  6. For each value in the list that contains unmodified salary information, calculate a raise in dollars according to the following rules:

    If the hourly rate is between 22 and 24 dollars per hour, apply a 5% raise to the current rate. If the hourly rate is between 24 and 26 dollars per hour, apply a 4% raise to the current rate. If the hourly rate is between 26 and 28 dollars per hour, apply a 3% raise to the current rate. All other salary ranges should get a standard 2% raise to the current rate.

    Add each new value you calculate to a new list called company_raises.
  7. Design your own complex condition with no fewer than four different truth tests in it (all conditions must be on one line, in other words). Above your condition, write out in comments the exact behavior you are implementing with Python.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#list that stores employee numbers
employeee_numbers=[1121,1122,1127,1132,1137,1138,1152,1157]
#list that stores employee names
employee_name=["Jackie Grainger","Jignesh Thrakkar","Dion Green","Jacob Gerber","Sarah Sanderson","Brandon Heck","David Toma","Charles King"]
#list that stores wages per hour employee
hourly_rate=[22.22,25.25,28.75,24.32,23.45,25.84,22.65,23.75]
#list that stores salary employee
company_raises=[]
max_value=0
#list used to store total_hourly_rate
total_hourly_rate=[]

underpaid_salaries=[]

#loop used to musltiply values in hourly_wages with 1.3
#and store in new list called total_hourly_rate
#len() is used to get length of list
for i in range(0,len(hourly_rate)):


#append value to the list total_hourly_rate
total_hourly_rate.append(hourly_rate[i]*1.3)

for i in range(0,len(total_hourly_rate)):


#finds the maximum value
if(total_hourly_rate[i]>max_value):


max_value=total_hourly_rate[i] #stores the maximum value

if(max_value>37.30):


print("\nSomeone's salary may be a budget concern.\n")

for i in range(0,len(total_hourly_rate)):


#check anyone's total_hourly_rate is between 28.15 and 30.65
if(total_hourly_rate[i]>=28.15 and total_hourly_rate[i]<=28.15):


underpaid_salaries.append(total_hourly_rate[i])

for i in range(0,len(hourly_rate)):


#check anyone's hourly_rate is between 22 and 24
if(hourly_rate[i]>22 and hourly_rate[i]<24):


#adding 5%
hourly_rate[i]+=((hourly_rate[i]/100)*5)


elif(hourly_rate[i]>24 and hourly_rate[i]<26):


#adding 4%
hourly_rate[i]+=((hourly_rate[i]/100)*4)


elif(hourly_rate[i]>26 and hourly_rate[i]<28):


#adding 3%
hourly_rate[i]+=((hourly_rate[i]/100)*3)


else:


#adding 2% for all other salaries
hourly_rate[i]+=((hourly_rate[i]/100)*2)


#adding all raised value to company_raises
company_raises.extend(hourly_rate)

#The comparison in single line
for i in range(0,len(hourly_rate)):


"""here i used ternary operator"""
hourly_rate[i]= (hourly_rate[i]+((hourly_rate[i]/100)*5)) if (hourly_rate[i]>22 and hourly_rate[i]<24) else (hourly_rate[i]+((hourly_rate[i]/100)*4)) if (hourly_rate[i]>24 and hourly_rate[i]<26) else hourly_rate[i]+((hourly_rate[i]/100)*2)

0 File Edit Foat Ran Options Widow Help list that stores enplcyee numbers employeee numbers-1121, 1122,1127, 1132, 113, 1138,

newPythonList.py-sers/svs97/Desktop/newPythonListpy (370 0 Eile Edit at Bun Options Window Help otal ourly rate-I] uriderpaid

Add a comment
Know the answer?
Add Answer to:
Create a single list that contains the following collection of data in the order provided: [1121,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create an HTML5 page that contains a form to collect the following data. The text in...

    Create an HTML5 page that contains a form to collect the following data. The text in bold indicates the id value that should be assigned to each html control: Product (drop down list) product – iPad, iPhone 6S, Galaxy 5S, Moto X, and so on Quantity (number) quantity Unit price (number) unit_price Discount (%)(number) discount_rate Date (date)   order_date First Name (text box)   first_name Last Name (text box)   last_name Payment type (drop down list)   payment_type – Visa, Master, Discover, Amex, and...

  • JAVA Lab Create a class called ArrayBasedStack. Declare the following variables: • data: references an array...

    JAVA Lab Create a class called ArrayBasedStack. Declare the following variables: • data: references an array storing elements in the list • topOfStack: an int value representing the location of the stack top in the array • INITIAL_CAPACITY: the default capacity of the stack public class ArrayBasedStack <E> { private E[] data; private int topOfStack; private static final int INITIAL_CAPACITY = 5; } Add a constructor that will initialize the stack with a user-defined initial capacity. The top of the...

  • Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment...

    Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment also aims at creating a C++ project to handle multiple files (one header file and two .cpp files) at the same time. Remember to follow documentation and variable name guidelines. Create a C++ project to implement a simplified banking system. Your bank is small, so it can have a maximum of 100 accounts. Use an array of pointers to objects for this. However, your...

  • please help Requirements: 1) Calculate the cost per cake 2) Create a budgeted Traditional Income Statement...

    please help Requirements: 1) Calculate the cost per cake 2) Create a budgeted Traditional Income Statement and a Contribution Income Statement 3) Calculate the breakeven point in dollars 4) Calculate a target profit in dollars for a profit of $125,000 Task 2 They believe it will cost them $250,000 to purchase the land near Fort Lee and to build a bakery and storefront. Your task is: 1) Calculate Return on Investment if the expected increase in net income, due to...

  • 1. SANCHEZ COMPUTER CENTER During the month of November the following transactions occurred. a. Record the...

    1. SANCHEZ COMPUTER CENTER During the month of November the following transactions occurred. a. Record the following transactions in the general journal and post them to the general ledger. b. Prepare a trial balance as of November 30, 201X. Assume the following transactions: Nov. 1 Billed Vita Needle Company $6,800, invoice no. 12675, for services rendered. Nov. 3 Billed Accu Pac, Inc., $3,900, invoice no. 12676, for services rendered. Nov. 5 Purchased new shop benches for $1,400 on account from...

  • The following formation applies to the questions displayed below. Web Wizard, Inc., has provided information technology...

    The following formation applies to the questions displayed below. Web Wizard, Inc., has provided information technology services for several years. For the first two months of the current year, the company has used the percentage of credit sales method to estimate bad debts. At the end of the first quarter, the company switched to the aging of accounts receivable method. The company entered into the following partial list of transactions during the first quarter. a. During January, the company provided...

  • Polaski Company manufactures and sells a single product called a Ret Operating at capacity, the company...

    Polaski Company manufactures and sells a single product called a Ret Operating at capacity, the company can produce and sell 36.000 Rets per year. Costs associated with this level of production and sales are given below: Unit $ 25 Direct materials Direct labor variable manufacturing overhead Fixed manufacturing overhead Variable selling expense Fixed selling expense Total cost 3 7 4 6 Total $ 9ee, eee 288,000 188, eee 252, eee 144,000 216,080 $ 1,908,000 $ 53 The Rets normally sell...

  • The following are screen grabs of the provided files Thanks so much for your help, and have a n...

    The following are screen grabs of the provided files Thanks so much for your help, and have a nice day! My Java Programming Teacher Gave me this for practice before the exam, butI can't get it to work, and I need a working version to discuss with my teacher ASAP, and I would like to sleep at some point before the exam. Please Help TEST QUESTION 5: Tamagotchi For this question, you will write a number of classes that you...

  • Refer to the following financial statements and answer the following questions hints:- 13. cash provided (used)...

    Refer to the following financial statements and answer the following questions hints:- 13. cash provided (used) by operating activities, investing activities, and financing activities. 14. cash-based net income. 15. estimate of uncollectible accounts receivable. 16. calculate and interpret accounts receivable ratio (most recent and prior period). hints:- 2:12 PM Wed Apr 15 39%). A 51.04cdn.com PART II NIKE, Inc. Consolidated Statements of Income in mWors, except per share data) Revenues Cost of sales Gross profit Demand creation expense Operating overhead...

  • The world’s 3 billion-plus smartphones emit the kind of data that health authorities covet during outbreaks....

    The world’s 3 billion-plus smartphones emit the kind of data that health authorities covet during outbreaks. They show where individuals are, where they’ve been and who they might have talked to or even touched — potentially offering maps to find infected people and clues to stopping new ones. But gaining access to this data, even amid a global pandemic, is made complex by the legal and ethical issues surrounding government access to information that can reveal intimate details about citizens’...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT