Question: Program Result Write a function that draws vertical lines on the graphics canvas. If a line is vertical, then the x-values for the endpoints are
Program Result
Write a function that draws vertical lines on the graphics canvas. If a line is vertical, then the x-values for the endpoints are the same.
The parameters to your function should be the x location and the length, and all of your lines should start at y position 0.
Your function must be named verticalLine.
For example if you call:
verticalLine(100, 200);
you should get a vertical line of length 200 starting at position (100, 0).
If your start function looks like:
function start(){ verticalLine(100, 200); verticalLine(200, 100); verticalLine(300, 20); Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
