Question: Write a JavaScript program to perform the following tasks: Compute the volume of a cylinder using the following pseudocode. We can hard code the value

Write a JavaScript program to perform the following tasks:

Compute the volume of a cylinder using the following pseudocode. We can hard code the value for the radius in this assignment. Later, we will learn how to accept input from a console. You can choose a few random values for the radius variable and test and validate your program's correctness.

declare variable radius and assign a value of 5 to the radius

declare a constant PI and assign a value of 3.14 to the PI constant (using keyword constant)

area = radius * radius * PI volume = area * length

print the result to the console using console.log()

console.log(volume);

(Please keep the code as simple as possible, this is only our first assignment)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!