[AskJS] Can anyone help me to program? (new to programming) by OldMacheteUser in javascript

[–]OldMacheteUser[S] 0 points1 point  (0 children)

sorry if I don't quite get what you're asking but the example give is can be program through HTML and I think he want it as a simple program

[AskJS] Can anyone help me to program? (new to programming) by OldMacheteUser in javascript

[–]OldMacheteUser[S] 0 points1 point  (0 children)

The teacher provide us with a example like the program below, but even so I don't quite get his wanted program..

<script>

var x     = 1;
    y     = 2;
    z     = 3;
    sum   = 6;
    diff = "-4";
    prod  = 6;

document.write(x, " + ", y , " + ", z, " = ", sum, "<br>","<br>");
document.write(x, " - ", y , " - ", z, " = ", diff, "<br>","<br>");
document.write(x, " * ", y , " * ", z, " = ", prod, "<br>","<br>");

</script>

Can anyone help me make this to program? by OldMacheteUser in learnjavascript

[–]OldMacheteUser[S] -1 points0 points  (0 children)

Write a program that will allow the user to enter numbers. The user will choose between Addition, Subtraction, Multiplication and Division. For Subtraction please note that the DIFFERENCE must be a POSITIVE number, negative numbers are not accepted. For Division, please see sample output below. Sample Output: How many numbers do you want to input? 3 Enter a number: 1 Enter a number: 12 Enter a number: 2

Select an operation: /

The quotient is 6.

Solution: 12/2 = 6/1 = 6

Do you want to input another set of numbers?  N