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
otez555 [7]
3 years ago
12

Create a web page that uses JavaScript to print a payroll report for a company that has a few employees, all earning the same ho

urly wage: $15 per hour for up to 40 hours per week. If the employee worked more than 40 hours, the hours in excess of 40 are paid at one and a half times this rate.
Computers and Technology
1 answer:
zhenek [66]3 years ago
3 0

Answer:

  1. let employee1 = {
  2.    Name : "Kate",
  3.    Hour : 38,
  4. };
  5. let employee2 = {
  6.    Name : "John",
  7.    Hour : 45,
  8. };
  9. let employee3 = {
  10.    Name : "Catherine",
  11.    Hour : 40,
  12. };
  13. let employeeArr = [employee1, employee2, employee3];
  14. let payrollRef = document.getElementById("payroll");
  15. let output = "";
  16. for(let i = 0; i < employeeArr.length; i++){
  17.    let h = employeeArr[i].Hour;
  18.    let pay;
  19.    if(h <=40){
  20.        pay = h * 15;  
  21.    }else{
  22.        pay = 40 * 15;
  23.        pay += (h - 40) * 15 * 1.5;
  24.    }
  25.    output += "Employee Name: " + employeeArr[i].Name + "<br>";
  26.    output += "Total working hour: " + employeeArr[i].Hour + "<br>";
  27.    output += "Total pay: $" + pay + "<br>";
  28.    output += "<hr>"
  29. }
  30. payrollRef.innerHTML = output;

Explanation:

Presume there is a div element with id "payroll" in a html file. We can write a JavaScript to create a payroll report and place the output to the div.

In JavaScript, let's presume there are only three employees and their names and total working hour are recorded in three objects (Line 1 - 14). Next, we put those employee objects into an array, employeeArr (Line 16).

Next, create a for loop to traverse through each object from employeeArr and calculate the pay based on their working hour (Line 22 - 31).

Next, generate the output string which includes employee name, working hour and total pay (Line 33 -36).

At last,  set the output string as the contents payroll (Line 39).

You might be interested in
Discuss your theory on why the light bulbs in the combination circuit have different brightness.
umka21 [38]
I believe lightbulbs have different brightness because of there quality parts that make it. The cheaper they are usually the worse quality. That is my theory.
5 0
3 years ago
Is a computer an input output or storage
Effectus [21]

Answer:

Explanation:

A computer is a machine that can be programmed to accept data (input), process it into useful information (output), and store it away (in a secondary storage device) for safekeeping or later reuse. The processing of input to output is directed by the software but performed by the hardware.

6 0
3 years ago
Which of the following is the best example of a manager with a delegator leadership style
monitta
No examples posted but here are a few examples;
Boss will send other employees to meetings in his/her place
Boss will leave other employees in. Charge when he/she is not there for a period of time.
Boss will assign special assignments
5 0
4 years ago
Read 2 more answers
Take the hypothetical situation that your business is considering a move to the cloud for core systems that contain confidential
zvonat [6]

Answer:

Solutions: to have a non-related to the company account and a back-up system.

Explanation:

My proposal is to move all the information of the bussiness to the cloud for better use of the data.

This data contains confidential health and finantial information and, in order to avoid any information non-wanted exit, the account has to be completing separated from the bussiness name  (more accounts),  by this way, it will be harder for extserns to get in it and substract the confidential information.

Also, the account must have a series of  security blocks to make it harder to  enter.

Finally, in case a virus gets in it and deletes any information, the data must have a backup system that will provide all the needed information in case it goes missing.

8 0
3 years ago
Dwayne wants a variable called "name" to appear in the interpreter and does not want a space after it. Which of these should be
ICE Princess25 [194]

Answer:

name + name

Explanation:

When assigning values to a Variable  in python, the + operator sums the values assigned to the variable into a single value hence there won't be any space between the values assigned .

Name + Name = NameName    in python programming

7 0
3 years ago
Other questions:
  • Assume that x is a double variable that has been initialized. Write a statement that prints it out, guaranteed to have a decimal
    5·1 answer
  • I swear I’m hopeless....
    8·1 answer
  • Which sentence best describes a lifestream?
    8·2 answers
  • Gina is upgrading your computer with a new processor. She installs the processor into your motherboard and adds the cooling syst
    13·2 answers
  • Given code:public abstract class A{ }public class B extends A{}The following code sequence would correctly create an object refe
    9·1 answer
  • Write an application program in C++ to implement a class Fibonacci to print Fibonacci series upto N using member function series
    9·1 answer
  • What is the best definition of a network?
    14·2 answers
  • HELLO. Which of the following is NOT a way to control the flow of a program?
    6·2 answers
  • What is the difference between encoding and decoding?
    9·1 answer
  • you're troubleshooting an ip addressing issue, and you issue a command to view the system's tcp/ip configuration. the command yo
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!