Super easy well not for me I guess

  You are currently not logged in. You can view the forums, but cannot post messages. Log In | Register

22-Oct-17 21:52
Just starting out in a programming course and I'm stumped and I frustrated I need to know how to get both the withholding's and net I cannot figure out how to write it so the program figures out both equations. Please help. Thanks.


<script>
var pay = prompt("Enter your houly pay");
var hour = prompt("Enter your hours worked");
var GROSS = parseFloat(pay * hour);
var WITH;
var NET;

if(pay < 300.01)
{
WITH = pay * hour * .10;
NET = pay - WITH;
alert(("GROSS PAY: $" + GROSS.toFixed(2)) + ("\nWITHHOLDING: $" + WITH.toFixed(2)) + ("\nNET PAY: $" + NET.toFixed(2)));
}
</script>
25-Oct-17 07:15
Using the correct variable in this conditional

if(pay < 300.01)

could be a starting point.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/
25-Oct-17 07:18
Oh and wage deductions are generally based on greater than calculations '>' rather than less than '<'

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/

 
New posts
Old posts

Follow Elated