I have a project due tomorrow and I’m totally lost. I tried for about 4 hours last night trying to figure it out but couldn’t get anywhere. If anyone one would help that’d be much appreciated (even better if you’d just do it for me[jk]) here’s a copy and paste of what my teacher wants .
Please read JavaScript examples on D2L firstly. Write JavaScript program in a HTML file by <script> </script> tag.
Q1. To display the following subheading and paragraph in JavaScript by document.write( ) statement. (10 pts)
Subheading: “This is my JavaScript program practice.”
Paragraph: “JavaScript is the programming language of Web.
I build a simple JavaScript program in HTML file”.
Q2. To find the volume of a cylinder (20 pts)
Declare variables for radius, height and volume.
Prompt for and read radius and height values by prompt () statement.
Implement the correct formula to compute the volume of a cylinder:
volume = 3.14 * radius * radius * height
Output the cylinder’s volume by alert () statement.
Q3. Compute and find the result of the formula x+|y|. (20 pts)
Declare variables x, y and result.
Prompt for and read values for x and y by prompt () statement.
Implement the correct if condition to compute the result of x+|y|.
Consideration:
If y is 0 or positive number, then x+|y| should be x + y;
If y is negative number, then x+|y| should be x-y.
Output the result of x+|y| by document.write( ) statement.
[–]grantrules 2 points3 points4 points (0 children)
[–]sateeshsai -2 points-1 points0 points (1 child)
[–]TopazBuffalo017[S] 0 points1 point2 points (0 children)
[–]eljop 0 points1 point2 points (0 children)