beginner help with code
I have an assigment as follows:
Create a webpage that will ask the user for a radius.
That number will be use to find the area of a circle with that radius, and then continue to calculate the next 9 circles with radii incrementing by one unit each time, and display the results to the page.
Then create a conditional statement that will limit the output to only even numbered radii.
Then a conditional statement that will limit the output to only radii divisible by 3.
And I have a code so far that looks like this:
Radius:<input type="text" name="radius" value=1><br>
<button type="button" onClick="calculate(radius.value)"> Get Next </button><br>
var pie = 3.14;
document.write("(" + rad + "+" + counter + ")" + "*" + "(" + rad + "+" + counter + ")" + "*" + pie + "=");
var area = ((parseInt(rad)+counter)*(parseFloat(rad)+counter))*(pie);
document.write(area + "<br>");
So far it's not working. I'm new to scripting, and I'm having trouble understanding what's wrong.
Hoping someone could help out.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread