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
If I wished to insert a hyperlink from text in my document to my company website, what type of link would I insert?
Dmitriy789 [7]

Answer:

the rain hyperlink and water from the ground

Explanation:

5 0
3 years ago
1. A cell is identified by its ........
earnstyle [38]
Answers:
1- cell address ( i think)
5 0
2 years ago
_KOH + _Cu(CIO3)2 - __KCIO3 +<br>_Cu(OH)2​
Lyrx [107]
K- 1 x 2 =2
OH- 1 x 2 = 2
Cu- 2
(CIO3)- 6

K- 1 x 2= 2
OH- 2
Cu- 2
(CIO3)- 3 x2=6

2KOH+ Cu(CIO3)2 - 2KCIO3+ Cu(OH)2
8 0
3 years ago
Missy creates a personal budget. She enters her current savings account balance in cell D3. In cell A3, she calculates her incom
sammy [17]
D3+(A3-B3) If you think of the future income and expenses then you can infer the expenses will lower the income amount so we use parenthesis and since there is money already in the account you would simply add that to the future total. <span />
7 0
3 years ago
Read 2 more answers
If you play gta and don't know the song ''Glamorous'' Then what do you even do when you play?
Paraphin [41]
You literally don’t do anything you’re just like dead of sun
4 0
2 years ago
Read 2 more answers
Other questions:
  • List and define the types of System Software. How does System Software differ from Applications Software?
    12·1 answer
  • Elise has just edited two photos of her cat and three different photos of her dog. She needs to save all five of these photos in
    5·2 answers
  • A(n) _____ is a type of man-in-the-middle attack where an attacker captures the data that is being transmitted, records it, and
    15·2 answers
  • When looking to ensure your website is easily accessible by mobile users, what should you focus on doing first
    8·1 answer
  • A user complains that his new mouse doesn't work right. He has an old system at home and when he has had this problem, he cleane
    11·2 answers
  • Which term refers to the blank areas surrounding a document page? *
    15·1 answer
  • Kara has been asked to create an employment application form for her company. Which of the following items can she use to make s
    10·1 answer
  • The Internet began when a large company wanted to sell products online. <br> True or flase?
    6·2 answers
  • What is an aspect ratio?
    6·1 answer
  • What is the main advantage of using DHCP?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!