Write a function to compute the amount of taxes

Assignment Help JAVA Programming
Reference no: EM131373595

Assignment: Javascript Payroll

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: EM131373595

Questions Cloud

Calculate the expected primary consolidation settlement : Calculate the expected primary consolidation settlement. The results of a consolidation test on the clay are given below.
What can they learn from the adopting innovation : What can they learn from the adopting innovation -  How can this be used to maintain a competitive edge?
Confidence interval for the average caloric content : Give a 95% confidence interval for the average caloric content of a 3-ounce cut of top loin steak. Also give a 98% confidence interval for the average caloric content of a cut.
Find the undrained and drained friction angles for the soil : A pore water pressure sensor recorded an excess pore pressure, (µd)f = 27.6 kN/m2 at failure. Determine the undrained and drained friction angles for the soil.
Write a function to compute the amount of taxes : ITEC 136- 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.
Create a list of steps for patient care : Create a list of steps for patient care. Then practice care of the fallen patient following your checklist. Submit for points.
Confidence interval for average monthly number of takeoffs : Landings and takeoffs at Schiphol, Holland, per month are (in 1,000s) as follows:- Assume a random sample of months. Give a 95% confidence interval for the average monthly number of takeoffs and landings.
How do we define an individual : How do we define an individual? Does asexual reproduction make it difficult to define what constitutes an individual within a population? Also, how does asexual reproduction allow for evolution? Relate this to antibiotic resistance in bacteria.
Stove and accidently touches the burner : Amy is cooking dinner for her family. She moves to pull a pot off the stove and accidently touches the burner. She reflexively pulls her finger away from the stove and immediately feels the pain.

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