Question: 4.1 Write a javascript program that will ask the user to enter three numbers then output the sum, sum of squares, product, and product of
4.1 Write a javascript program that will ask the user to enter three numbers then output the sum, sum of squares, product, and product of squares. E.g. if user entered 2, 3, and 4, then your browser will display something similar to the following
Exercise 4.2 Write a javascript program that ask user to enter three numbers, your program will then output the number, the square of the number and the cube of the number on a table like the following. E.g. if the user entered 3,4 and 5 then a table similar to the following will display on your browser. While a negative number is acceptable and its square and cube can be computed, your program will give an alert to the user saying he/she entered a negative number. Number Square Cube 3 9 27 4 16 64 5 25 125
Exercise 4.3 Write a javascript that to compute Einsteins famous equation which transfer mass into energy. The equation says E = MC2 where E is energy and its unit is Joules and M is mass its unit is Kilogram and C is the light speed which is 299 792 458 (meter per second) . Ask user to enter mass in Kilogram then calculate the Energy in Joules when the mass is converted into energy.
Exercise 4.4 Write a javascript that ask the user to enter three (3) numbers and output the counts of positive number, negative number or zero.
Exercise 4.5 Write a javascript that ask the user to enter a number between 20 and 40. Your program will then output a paragraph with font-size as specified by the user. If the user entered number is greater than 40 then you program will make the font-szie 40. If the number is less than 20 or negative then you rpogram will make the display font size 20. If the number is even then the text color would be lightgreen and it out say it is cool. If the number is an odd number then the text color will be red and it says hot. Assuming the paragraph will say I like internet computing. It is cool!!! if number is even. If the number entered after modified become odd then the output is I like internet computing. It is hot!!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
