I got an unexptected identifier error on this line:
If userInput <= 7
I really am new at this and I don't understand what that means. I'm new to javascript but I'm learning. I don't know what else to say as my knowledge of programming isn't great at all.
<html>
<body>
<script type="text/javascript">
// Declare Constants and Variables
var stateTax;
var userInput;
var finalTax;
var BR = "</br >"; // Line break
var ES = " "; // Empty string
// Welcome user
document.write("Welcome to Sales Tax Calculator" + BR);
document.write("This program calculates sales tax");
document.write("under $1.00");
// take user input
userInput = Prompt("Please enter a number(Cents)" + ES);
// call selection structure
If userInput <= 7 then
stateTax = 0;
else if userInput <= 21 then
stateTax = 1;
else if userInput <= 35 then
stateTax = 2 ;
else if userInput <= 49 then
stateTax = 3;
else if userInput <= 64 then
stateTax = 4;
else if userInput <= 78 then
stateTax = 5;
else if userInput <= 92 then
stateTax = 6;
else if userInput <= 99 then
stateTax = 7;
else if userInput > 99 then
document.write("Error, Please enter a value less than 99!");
end if
// Calculate and Display sales tax
finalTax = userInput * stateTax;
document.write("Sales tax equals: " + finalTax);
document.write("Thank you for using tax calculator");
</script>
</body>
</html>
, something wrong with the syntax... – Proxytype Jun 27 '15 at 00:29