Write function to calculate gross wages for hourly employee

Assignment Help JAVA Programming
Reference no: EM131396215

Assignemnt

1. In a separate JS file, write a function to calculate gross wages for an hourly employee. The function should receive two parameters: the pay rate (dollars per hour, a floating point number) and the hours worked. Hours from 0 through 40 are "straight time" pay, and any hours in excess of 40 are overtime pay at 1.5 times the standard rate (hint: use the ? : operator to make a decision about pay rates). The function should return a floating point number representing the gross pay amount. Note, the function should not do any output such as document.writeln or alerts.

2. In a separate JS file, write a function to compute the amount of taxes that should be withheld from a paycheck based on the gross pay. The function should receive one parameter, the gross pay. Withholdings are calculated based on the following table:

Category Percentage

Federal taxes 31%

State taxes 8%

Local taxes 2%

All local taxes are deductable from the gross amount used to calculate state taxes. Likewise all state and local taxes are deductable from the gross amount used to calculate federal taxes. The function should accept one parameter, the gross pay, and return one result, the total withholdings based on the above table and rules. Again, the function should not do any output, but should just return a number. Here is an example:

Input: 1000.00, return 377.90. Why not just 41% of 1000 = 410? 2% of $1000.00 is $20.00. Now subtract the $20.00 out of the gross, leaving $980.00 as the base for calculating state taxes. 8% of $980.00 is $78.40. Subtract $78.40 from the $980.00 to get $901.60, the base for calculating federal taxes. 31% of $901.60 is $279.50 (rounded to the nearest penny). When $20.00, $78.40, and $279.50 are added together, the result is $377.90, which is the answer that should be returned from the function. Note that these numbers are rounded to the nearest penny, which is possible with either the .toFixed() method of a number or by using Math.round().

Reference no: EM131396215

Questions Cloud

Criticize the given definitions - a house is a structure : Criticize the following definitions in light of the eight rules for lexical definitions:- A house is a structure made of wood or stone intended for human habitation.
Purchasing agent for a municipality : The purchasing agent for a municipality has contracted with a local car dealer to purchase four cars. The dealer has 25 cars on his lot; 10 red, 7 blue, 6 white, and 2 purple.
When an organization is preparing to outsource : When an organization is preparing to outsource and staff may/could lose their positions, what do you think is their biggest need from the organization?
Criticize the given definition - satire is a kind of glass : Criticize the following definitions in light of the eight rules for lexical definitions:- Satire is a kind of glass, wherein beholders do generally discover everybody's face but their own.
Write function to calculate gross wages for hourly employee : In a separate JS file, write a function to calculate gross wages for an hourly employee. The function should receive two parameters: the pay rate (dollars per hour, a floating point number) and the hours worked.
Purchase and the decision making process : Consider your last vehicle purchase and the decision making process you engaged in while deciding what vehicle to purchase or if a new vehicle was the right decision. While analyzing your decision, keep in mind that everything from the interest ra..
Criticize the given definitions - a carpenters square : Criticize the following definitions in light of the eight rules for lexical definitions:- A carpenter's square is a square used by a carpenter.
Fall in the price of televisions : Then, show how the wage changes in Canada due to a fall in the price of televisions, holding constant the price of timber. Can we predict that change in real wages?
Motivation - understanding self and others : Create a summary of the reading, also, develop two critical questions rising from the reading along with two ideas/concepts that you have found enlightening or thought to provoke.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd