JavaScript for beginners

1.Create an html page, add 3 text boxes in which the user will input 3 numbers :a,b,c
Add a button that, on click, will calculate ((a*b) + (b*c)) / (a+b). The result will be displayed in an alert.

2. Create an html page, add 3 text boxes in which the user will input 3 numbers :a,b,c
Add a button that, on click, will calculate the maximum number of the three. The result will be displayed in an alert. The program should not crash if the user does not input one or two numbers.
Cases:
-If no number is introduced then a message should be displayed asking the user to input at least on number.
-If only one number of the three is introduced, that number is the maximum number.
-If two numbers are introduced then it should be displayed the maximum of the two.
-If three numbers are introduced then it should be displayed the maximum of the three.

3. Create an html page, add 2 text boxes in which the user will input 2 numbers: n and m
Add a button that, on click, will calculate the sum of all even numbers between n and m, regardless id n < m or m <  n. The result will be displayed in an alert.

Leave a Reply

Your email address will not be published. Required fields are marked *