Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will complete the implementation of the following functions: function processCheck() { } - This is the main function, the one which will be called

You will complete the implementation of the following functions: function processCheck() { } - This is the main function, the one which will be called when the button is pressed. From here you will call the other functions in order to obtain all the required information to populate the input fields. Use the given function getValueString(val) were val is a real number value. function getName() { } - A simple function which returns the concatenation of firstname+middlename+lastname. function getAddress() { ... } - Just as getName, but it returns a single string with the following format: Address, City, State, Zip Note the break line from address to the last line. This can be achieve with the special character function calculateTotal() { } - return a single value, rounded to TWO digits. You will compute the total BI-WEEKLY (26 paychecks per year) salary based on the following rules: CAT A - Manufacturing $55000 CAT B - Accounting $69500 CAT C - Administrative $58700 CAT D - IT $73200 Night shift 10% extra Rotating 15% No Health Plan 2% discount for general deductions HMO Health Plan 9% discount PPO Health Plan 11% discount function validateFields() { } - It must check that firstNameBox, lastNameBox, addressBox, cityBox, stateBox and zipBox are NOT empty. Return true if all ok, otherwise it returns false. For all this implementations, you can use the following built-in functions (already given): alert(val) - val is a string Math.round(val) - val is a number Math.random() - returns a random real number from [0 , 1] (0, 0.456, etc) Data d = new Date() - getMonth() , getDaye(), getFullYear() - Documentation here. getValueString(val) - val is a up-to-two-digits real number. string.indexOf(val) - val is a word, it return -1 if the word doesnt exist in the string. Documentation. number.toFixed(2) - 2 is the number of desired round-to decimal places for number. You will find more instructions within the document, but as an example, here are some indications on how to organize your code: function processCheck() { /* Check all the fields are valid, otherwise just return */ /* Populate RANDOM check whole number between 10000 and 20000 */ /* Populate today's date with format mm-dd-yyyy */ /* Populate full name */ /* Populate address */ /* Populate dollar amount */ /* Populate money */ } If you complete those pieces of code, your implementation will be complete. processCheck is the main function which is called by the onclick DOMEvent on theelement.

skeleton

Auto Paycheck


CS170 Management Group Rutgers University 7 College Ave, New Brunswick, NJ 08901
Check Number
Pay Date

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

What is Aufbau's rule explain with example?

Answered: 1 week ago