Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE HELP WITH JAVA!! Below are instrictions and a Source/Skeleton code that need to be filled in. I don't understand how to make it work.

PLEASE HELP WITH JAVA!!

Below are instrictions and a Source/Skeleton code that need to be filled in. I don't understand how to make it work.

image text in transcribedimage text in transcribed

Here is the Skeleton Source code:

/* Your code starts here */
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 */
}
function getName() {
// complete here
}
function getAddress() {
// complete here
}
function calculateTotal() {
/* Calculate base salary yearly / 26 */
/* Adjust based on shift */
/* Discount Health Plan */
}
function validateFields() {
}
/* end of code */

Auto Paycheck


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

function getValueString(val) {
var str = new String(val);
var cents = str.indexOf('.');
if(cents != -1) {
cents = Number(str.substring(cents+1));
}
val = Math.floor(val);
var dig = 1000;
var s = "";
while((new String(dig)).length > 2) {
if(dig
var v = Math.floor(val / dig);
str = new String(dig);
if(v != 0) {
switch(v) {
case 10:
s += 'ten ';
break;
case 9:
s += 'nine ';
break;
case 8:
s += 'eight ';
break;
case 7:
s += 'seven ';
break;
case 6:
s += 'six ';
break;
case 5:
s += 'five ';
break;
case 4:
s += 'four ';
break;
case 3:
s += 'three ';
break;
case 2:
s += 'two ';
break;
case 1:
s += 'one ';
}
if(str.length == 4) {
s += 'thousand ';
} else if(str.length == 3) {
s += 'hundred ';
}
}
val %= dig;
}
dig /= 10;
}
s += 'and ' + val + ' dollars with ' + cents + ' cents';
return s;
}
body {
min-width: 1080px;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}
#infoForm {
width: 50%;
margin: auto;
margin-top: 2em;
}
#infoForm table {
border-collapse: separate;
border-spacing: 15px;
-webkit-box-shadow: 0 10px 6px -6px #222;
-moz-box-shadow: 0 10px 6px -6px #222;
box-shadow: 0 10px 6px -6px #222;
padding: 1em;
color: white;
background: rgb(120,120,120);
border-radius: 5px;
margin: auto;
}
#infoForm input[type=text], select {
border-radius: 3px;
font-size: 110%;
color: #333;
padding: 5px;
border: none;
background: rgb(170,170,170);
border-bottom: 1px solid #EEE;
width: 100%;
}
select {
padding: 20px;
}
input[type=text]:focus {
outline: 2px solid #FFF;
}
#radioRow {
text-align: center;
}
#radioRow label, #radioRow input[type=radio] {
margin: 0 2% 0 2%;
}
#autoCheck, h1 { margin: auto; margin-top: 1em; width: 90%; }
#autoCheck {
border-radius: 15px 0 15px 0;
background: #DDD;
-webkit-box-shadow: 0 10px 6px -6px #222;
-moz-box-shadow: 0 10px 6px -6px #222;
box-shadow: 0 10px 6px -6px #222;
}
#autoCheck input {
font-size: 90%;
padding: 2px;
}
#autoCheck input:placeholder-shown {
text-align: center;
}
.centered {
text-align: center;
}
#autoCheck hr {
margin: 10px;
border: 0;
height: 1px;
background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}
#orderDiv input, #orderDiv textarea {
margin: 5px;
width: 40%;
}
#processBtn {
background: #CCC;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0px;
color: #333;
font-size: 18px;
padding: 10px 20px 10px 20px;
text-decoration: none;
margin-top: 20px;
}
#orderAddress {
resize: none;
border: none;
}
The following fields MUST have information: First Name, Last Name, Address, City, Zip Code, State Once all three fields were populated, and the button pressed, the program's logic (to be implemented) will compute all required components and set them in the proper fields. You only need to populate the following fields within the paycheck: Check Number check Number Box Pay Date payDateBox Dollar Amount (NOT the words, that happens automatically assuming your computation is right) The name of the employee orderName The address of the employee order,Address Money description payMoney Instructions You will complete the implementation of the following functions: function processCheck0 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 getAddress0 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 In function calculateTotal0 1... return a single value, rounded to TWO digits. You will compute the total Bl-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% discount for general deductions No Health Plan HMO Health Plan 9% discount PPO Health Plan 11% discount

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

More Books

Students also viewed these Databases questions