1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
wel
3 years ago
12

Write a program to compute an employee's weekly pay and produce a pay slip showing name, gross, pay, deductions, and net pay. Th

e program should first prompt the user for: a. Family name b. Given name c. Hourly rate of pay d. Number of hours worked that week (Any hours over 40 are paid at double the normal hourly rate) e. A letter indicating the employee's tax category A. No tax deduction B. Tax is 10% of gross pay C. Tax is 20% of gross pay D. Tax is 29% of gross pay E. Tax is 35% of gross pay f. Either a Y or an N to indicate whether or not the employee wants $20 deducted from the weekly pay as a contribution to the United Way Charity
Computers and Technology
1 answer:
Umnica [9.8K]3 years ago
6 0

Answer:

# get the employee data

family_name = input("Enter family name: ")

given_name = input("Enter given name: ")

hourly_rate = int(input("Enter hourly rate of pay: "))

hours = int(input("Enter hours worked for the week: "))

tax_cat = input("Enter tax category from a through e: ")

is_charit = input("Do you want to donate $20 to charity y/n: ")

gross_pay = 0

net_pay = 0

deductions = ""

# gross_pay

if hours > 40:

   gross_pay = hours * (2 * hourly_rate)

else:  

   gross_pay = hours * hourly_rate

# net_pay and deduction

if tax_cat == 'a':

   if is_charit == 'y':

       net_pay = gross_pay - 20

       deduction = "$20 charity donation"

   else:

       net_pay = gross_pay

       deduction = "0% tax"

elif tax_cat == 'b':

   if is_charit == 'y':

       net_pay = gross_pay - ( 0.1 * gross_pay) - 20

       deduction = "$20 charity donation and 10% tax"

   else:

       net_pay = gross_pay - (0.1 * gross_pay)

       deduction = "10% tax"

elif tax_cat == 'c':

   if is_charit == 'y':

       net_pay = gross_pay - ( 0.2 * gross_pay) - 20

       deduction = "$20 charity donation and 20% tax"

   else:

       net_pay = gross_pay - (0.2 * gross_pay)

       deduction = "20% tax"

elif tax_cat == 'd':

   if is_charit == 'y':

       net_pay = gross_pay - ( 0.29 * gross_pay) - 20

       deduction = "$20 charity donation and 29% tax"

   else:

       net_pay = gross_pay - (0.29 * gross_pay)

       deduction = "29% tax"

if tax_cat == 'e':

   if is_charit == 'y':

       net_pay = gross_pay - ( 0.35 * gross_pay) - 20

       deduction = "$20 charity donation and 35% tax"

   else:

       net_pay = gross_pay - (0.35 * gross_pay)

       deduction = "35% tax"

# output of the employee's weekly pay.

print(f"Employee name: {given_name} {family_name}")

print(f"Gross pay: ${gross_pay}")

print(f"Net pay: {net_pay}")

print(f"Deductions: {deduction}")

Explanation:

The python program uses the input built-in function to prompt and get user data for the program. The gross pay returns the total pay of the employee without any deduction while net pay returns the pay with all deductions included.

You might be interested in
In honor of Black History Month, write an essay about a black person who has inspired YOU in some way. This person does not have
babymother [125]

Answer:

I will be talking about Jackie Robinson. Robinson was known for playing baseball with the Brooklyn Dodgers from 1947 to 1956, I will share a few of his other accomplishment.

In 1935, Robinson graduated from Washington Junior High School and enrolled at John Muir High School Recognizing his athletic talents, Robinson's older brothers Mack (himself, an accomplished athlete and silver medalist, at the 1936 Summer Olympics) and Frank inspired Jackie to pursue his interest in sports.

At Muir high school , Robinson played several sports , football, basketball, track, baseball and tennis. He played shortstop and catcher on the baseball team, quarterback on the football team, and guard on the basketball team. With the track and field squad, he won awards for the broad jump.

In 1936, Robinson won the junior boys singles championship at the annual Pacific Coast Negro Tennis Tournament.

He earned a place on the annual baseball tournament all-star team,

In late January 1937, the News newspaper reported that Robinson "for two years had been the outstanding athlete at John Muir, starring in football, basketball, track, baseball and tennis.

As Jackie was encouraged to move forward by his brothers Mack and Frank. Today, his accomplishments inspires me to keep moving forward.

Explanation:

3 0
3 years ago
A specially formatted encrypted message that validates the information the CA requires to issue a digital certificate is known a
Pavel [41]

Answer:

Certificate Signing Request(CSR).

Explanation:

Certificate Signing Request(CSR):- It is a message that is specially encrypted Which validates the information that is required by CA for the issuing of a digital certificate.

It is the first step towards getting your own SSL certificate.

So we conclude that the answer to this question is Certificate Signing Request (CSR).

5 0
3 years ago
Conduct a site research on a specific property using the concepts discussed during this week.
Anni [7]

Answer:Penis!

Explanation:

Haha! Enjoy your day! Hahahahaha!

8 0
3 years ago
Today you will be researching three forms of technology.
Mamont248 [21]

Answer:

why

Explanation:

4 0
3 years ago
Tech A says that no matter which way the vehicle turns, the inside wheel must always turn less sharply than the outside wheel. T
vodomira [7]
The answer is c because the perpendicular bicector alligns.
5 0
3 years ago
Other questions:
  • Which of the following is a strategy used to enhance communication in a presentation?
    14·1 answer
  • What are some characteristics of filtering junk email in Outlook 2016? Check all that apply.
    10·2 answers
  • What changes can be done using image editing tool?<br> a) Resize b) Crop c) Resize and crop
    6·1 answer
  • Group of answer choices When declaring a variable, you also specify the type of its values. Variables cannot be assigned and dec
    7·1 answer
  • a term to describe article that can be displayed in their entirety as opposed to abstract and reference only?​
    10·1 answer
  • Compile and Execute a Program
    13·1 answer
  • What relationship do MP3s and MP3 players have with video files?
    11·1 answer
  • A(n) ___ is a set of CPUs which work in parallel in an attempt to simulate the way the human brain works, although in greatly si
    5·1 answer
  • A.Distance sensor<br> b.Programable microcontroller<br> c.Ambient light sensor<br> d.Wi-Fi
    9·2 answers
  • True or false: if you are adding your own css sheet, make sure your css file comes before the bootstrap css file.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!