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
astraxan [27]
4 years ago
10

In this lab, you complete a Python program that calculates an employee's annual bonus. Input is an employee's first name, last n

ame, salary, and numeric performance rating. If the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. If the rating is 4 or higher, the rate is 0. The employee bonus is calculated by multiplying the bonus rate by the annual salary.

Computers and Technology
1 answer:
HACTEHA [7]4 years ago
8 0

Answer:

The program is as follows (See attachment)

Comments are used to explain some lines

Fname = input("Enter Employee First Name: ")

Lname = input("Enter Employee Last Name: ")

Salary = float(input("Enter Employee Salary: "))

Ratings = int(float(input("Enter Employee Ratings: ")))

#Initialize bonus rate to 0; This will be used if ratings is 4 or 4

bonusRate = 0.0

if Ratings == 1:

       bonusRate =0.25 #If ratings is 1, bonus rate is 0.25

elif Ratings == 2:

       bonusRate = 0.15 #If ratings is 2, bonus rate is 0.15

elif Ratings == 3:

       bonusRate = 0.1 #If ratings is 3, bonus rate is 0.1

bonus = Salary * bonusRate

print(Lname+" "+Fname+"'s employee bonus is "+str(bonus))

#End of Program

Explanation:

The program saves the employee's first name and last name in variables Fname and Lname, respectively

The employee's salary is saved as float datatype in variable Salary

The employee's ratings is saved as int datatype in variable Ratings

For ratings greater than or equal to 4, the bonusRate is set to 0.0; this is done on line 6 of the program

Line 7 to 12 check if employee Ratings is 1, 2 or 3 and the respective bonusRate is used

Line 13 calculates the employee's bonus

Line 14 prints the employee's bonus

The program is ended on line 15

You might be interested in
What the repeal of online privacy protections means for you?
kvv77 [185]
Online Privacy is well, our privacy while on the internet. If they have repealed that, then we have no privacy while on the internet. I feel like now a days there is no privacy at all anywhere. Everywhere you go, there are cameras watching you. So for them to take away online privacy is pretty messed up.
7 0
4 years ago
When would you use conditional formatting on a cell?
Charra [1.4K]
You use conditional formatting on a cell if the numbers are less then zero.
4 0
3 years ago
Consider a sequence of 1's and 1's with the property that the sum of any prefix of the sequence is never negative For example th
MrMuchimi

Answer:

Check the explanation

Explanation:

Answer: Solution: Algorithm:

Step 1: Start.

Step 2: Create a stack Step

3: Push an initial stack variable, it will represent that, stack is empty.

Step 4: Get input

             If +1 then push "+1"

             Else if -1 then pop

Step 5: Repeat until all input finish or Stop if empty stack variable popped. Step 6: Stop.

It is a pushdown automata problem.

It can be also represented as:

X =1+1* —1* 1No(+1)>= No(-1)}

4 0
3 years ago
What should an administrator use to more easily assign database access permissions to multiple users?
Kruka [31]

Answer:

to allow administrators to assign rights and permissions to multiple users

Explanation:

8 0
3 years ago
In this lab you will write a C program to sort an array of strings. The program will: Create an array of 50 strings; each string
andrezito [222]

Answer:

See explaination

Explanation:

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

void swap(char *arr[], int i, int minIdx)

{

char temp[30];

strcpy(temp, arr[i]);

strcpy(arr[i], arr[minIdx]);

strcpy(arr[minIdx], temp);

}

void sort(char *arr[], int n)

{

for (int i = 0; i < n - 1; i++)

{

int minIdx = i;

int minV = 10000;

char min[30];

strcpy(min, arr[i]);

for (int j = i + 1; j < n; j++)

{

int a = strcmp(min, arr[j]);

if (a < 0)

{

strcpy(min, arr[i]);

minIdx = j;

}

}

swap(arr, i, minIdx);

}

}

void print(char *arr[], int n)

{

for (int i = 0; i < n; i++)

printf("%s", arr[i]);

}

void read(char *arr[], int *n)

{

FILE *file = fopen("strings.dat", "r");

char line[30];

*n = 0;

printf("Reading from file...\n");

while (fgets(line, 30, file))

{

strcpy(arr[(*n)++], line);

}

print(arr, *n);

}

int main(int argc, char const *argv[])

{

char *arr[50];

for (int i = 0; i < 50; i++)

arr[i] = (char *)malloc(sizeof(char) * 30);

int len;

int n = 0;

read(arr, &n);

printf("\n-------------------------\nAfter sorting\n");

sort(arr, n);

print(arr, n);

}

6 0
3 years ago
Other questions:
  • On most computers, the default font size in word is ____. 8 11 14 16
    8·2 answers
  • To increase the view of a document on the screen, use the _____. View icon Zoom slider full-screen reading boldface font
    9·1 answer
  • Which track-type can be used to control the master output levels of output and bus paths? Hint: When assigned to an active outpu
    10·1 answer
  • For this lab you will find the area of an irregularly shaped room with the shape as shown above.
    7·1 answer
  • Which of these techniques will contribute to green computing?
    10·1 answer
  • What does the bit pattern 01000000 represent?
    7·1 answer
  • Why should the ISO be adjusted when taking a picture of a child blowing out candles in a darkened room?
    10·1 answer
  • Ifdjgidfpojcjdizchnllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllsssssssssssssssssssssssssss
    13·2 answers
  • _____ are labels for data, while _____ tie values together into one entity.
    15·1 answer
  • Plz plz plz help me with me
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!