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
Zinaida [17]
3 years ago
9

Write a program to calculate the total salary of the employees in an office. The program will first prompt the user to enter the

number of employees. For each employees, the program asks the user to enter the pay rate and hours worked.

Computers and Technology
2 answers:
seraphim [82]3 years ago
8 0

Answer:

# the user is prompt to enter the number of employees

number_of_employees = int(input("Enter number of employee: "))

# the total_salary is initialized to 0

total_salary = 0

# for loop that loop through the number of employees

# and calculate the salary for each by multiplying the rate & hour

for each_employee in range(number_of_employees):

   employee_hour = int(input("Enter your worked hour: "))

   employee_rate = int(input("Enter your rate: "))

   employee_salary = employee_hour * employee_rate

   # the total salary is gotten by adding it to employee salary

   total_salary += employee_salary

   

# The total salary is displayed.

print("The total salary for the entire employee is: $", total_salary, sep="")    

Explanation:

The program is written in Python and is well commented. An image for the program output when it is executed is attached.

raketka [301]3 years ago
6 0

Answer:

import java.util.Scanner;

public class Salary

{

public static void main(String[] args) {

   

    int numberOfEmployees;

    double payRate, numberOfHours, totalPay = 0;

       Scanner input1 = new Scanner(System.in);

       Scanner input2 = new Scanner(System.in);

       System.out.print("Enter the number of employees: ");

       numberOfEmployees = input1.nextInt();

       

       for(int i=1; i<=numberOfEmployees; i++) {

           System.out.print("Enter the pay rate for employee " + i + ": ");

           payRate = input2.nextDouble();

           System.out.print("Enter the number of hours worked: ");

           numberOfHours = input2.nextDouble();

           

           totalPay += (payRate * numberOfHours);

       }

       

       System.out.println("Total payment is: "+ totalPay);

}

}

Explanation:

- Declare the variables

- Ask the user the for the number of employees

- Inside the for loop, ask the user for pay rate and hours worked for each employee

- Calculate the total pay

- <u>Outside of the loop</u>, print the total pay

You might be interested in
How does this happen on brainly????
Trava [24]

what do you mean????

4 0
3 years ago
Read 2 more answers
Imagine the deep, low sound made by a tuba. Now, what is an example of a sound with a much higher pitch?
goblinko [34]
B.) The rumble of thunder.
I hope this helps. :p
7 0
3 years ago
Read 2 more answers
Vocabulary and Bridge Information
motikmotik
Umm
This is to bunch of questions..
6 0
2 years ago
I / a / caught / when / was / on / disease / holiday / I​
statuscvo [17]

Answer:

Ig it'd be - I caught a disease when i was on a holiday.

4 0
3 years ago
Read 2 more answers
How can these requirements be met? Universal Containers conduct evaluations of their sales reps using a custom object consisting
Rudik [331]

Answer:

The answer is B. Use a private sharing model granting record access using custom setting; manage field access with page layouts and field level security

Explanation:

The answer is B. Use a private sharing model granting record access using custom setting; manage field access with page layouts and field level security.

The reason the answer is B is because if access is provided through a hierarchy, it will give access to all the users at the higher manager role for the records of every executive. Also the options provided do not state clearly if Grant access using hierarchy is also checked so we cant assume that.

4 0
3 years ago
Other questions:
  • Which piece of personal information do websites often require users to enter?
    6·2 answers
  • Gal runs a music store. He has a desktop computer in the back room that acts as a server. He has a point-of-sale terminal that c
    15·1 answer
  • Select the focus questions that emphasizes what is more important: (Select all that apply) a.What needs to be relegated to the b
    8·1 answer
  • Which of the following software program provides for email communication
    13·2 answers
  • The Knowledge Consistency Checker (KCC) ensures the maximum number of hops between any two domain controllers does not exceed wh
    12·1 answer
  • What video game has made the most money as of 2016?
    15·2 answers
  • Why does brainly keep saying “oops... something went wrong! Try again”
    7·2 answers
  • what will be the Trade discount and Invoice Amount if the List Price is $400.00 and the Trade Discount Rate is 85%
    14·1 answer
  • If I wanted to include a picture of a dog in my document, I could use _____. SmartArt WordArt clip art AutoCorrect
    13·1 answer
  • Type the correct answer in the box. Use numerals instead of words. If necessary, use / for the fraction bar.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!