Go and view a completed version of the web application you are going to build today at http://mylinux.langara.bc.ca/~jmckeescott/1045/lab6.html
Write a function called isValidNumber(inputNum, validMin, validMax). This function will take in a number (the inputNum parameter) and return true if the number is greater than or equal to validMin and less than or equal to validMax. The function should return false if the number is outside of this range, or if inputNum is not a number.
Write a function called drawObject(x, y) which draws your shape on the canvas at the location given by the parameters x and y. You can choose to draw whatever shape you would like (it does not have to be cats!).
NOTE: If in this function you modify the local coordinate system in any way, it is important that you use save and restore so that the coordinate system is restored back to default before the function exits.
Prompt the user to enter a number of objects to draw to draw on the canvas (let’s call this number N).
Verify that the input is valid using the function you created in step 3. If the input is not valid, inform the user that input is not valid, and ask them for another value. N should be a reasonable number of objects to draw on the canvas
Prompt the user to enter a distance (let’s call it R). This will be how far from the center of the circle you draw each shape.
Verify that the input is valid, again using your function from step 3. If the input is not valid, inform the user that the input is not valid, and ask them for another value. R cannot be too large or your shapes will be drawn off the canvas. R cannot be negative.
Finally, draw N of your shapes in a circle on the canvas, with each shape R distance away from the center of the canvas. The objects should all be equally spaced along the circle.
Here is a sample screenshot with R = 100 and N = 4
Submit to D2L ONE zip/archive file containing all of your files from this lab
If you do not zip your files, you will receive ZERO for this lab (http://www.wikihow.com/Zip-Files-Together)
Marks will be assigned as follows:
4 marks for toRad(angle)
7 marks for isValidNumber(inputNum, validMin, validMax)
6 marks for drawObject(x, y)
13 marks for step 6
1 mark each for A and C
3 marks each for B and D
5 marks for E
Note: In step 5 you must use all of the functions you created in steps 1-4 or you will receive 0 for steps B, D, and E