Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document.writeln("Exercise 3.1");
- document.writeln("<hr>");
- var tal1;
- var tal2;
- function numberInput()
- {
- tal1 = prompt("Wilkommen till kalkylatorn", "Skriv tal 1");
- tal2 = prompt("Wilkommen till kalkylatorn", "Skriv tal 2");
- }
- function addition()
- {
- var additionResult;
- additionResult = parseInt(tal1) + parseInt(tal2);
- return additionResult;
- }
- function multiply()
- {
- var multipliedResult;
- multipliedResult = parseInt(tal1) * parseInt(tal2);
- return multipliedResult;
- }
- function subtract()
- {
- var subtractedResult;
- subtractedResult = parseInt(tal1) - parseInt(tal2);
- return subtractedResult;
- }
- function division()
- {
- var dividedResult;
- dividedResult = parseInt(tal1) / parseInt(tal2);
- return dividedResult;
- }
Advertisement
Add Comment
Please, Sign In to add comment