|
Java Script help
Yet another question dealing with homework......didn't pay attention one day in class so I missed how to do one part of my homework.
Alright.....we suppose to make a code that allows the user to punch in 2 numbers and make it add and multiply the numbers.
Well...got it to multiply but can get it to add correctly
here is the code I'm using (all within the Javascript open/closing tags....the bold line is whats messing me up I think:
var userLastName
var userFirstName
var inputFirstNumber
var inputSecondNumber
var answerAdded
var answerMultiplied
var userLastName = prompt ("Enter your LAST name:")
var userFirstName = prompt ("Enter your FIRST name:")
var inputFirstNumber = prompt ("Enter your FIRST Integer:")
var inputSecondNumber = prompt ("Enter your SECOND Integer:")
var answerMultiplied = inputFirstNumber * inputSecondNumber
var answerAdded = inputFirstNumber + inputSecondNumber
document.write ( "
" + userFirstName + " " + userLastName
+ ", When you MULTIPLY those two numbers, your answer will equal "
+ answerMultiplied + ". On the other hand, when you ADD those two numbers, the sum will equal "
+ answerAdded + "" )
Will be on the forum for awhile so will respond pretty fast
___________________
The Friday Night Backspin - 90.9 FM 6-10 PM
My Website
WTB--Favorite/WTB Vinyl:
1.Baby Anne- Version 5.1
2.Silicone Works- Daylight (Breaks)
Please PM me if you have these.
|