Question: Part 1 For Part 1 you will write three line-drawing functions. ( begin{array}{ll}text { # function: horizontal_line } text { # input: } &


Part 1 For Part 1 you will write three line-drawing functions. \( \begin{array}{ll}\text { \# function: horizontal_line } \\ \text { \# input: } & \text { a vidth value (integer) } \\ \text { \# processing: prints a single horizontal line of the desired size } \\ \text { \# output: } & \text { does not return anything }\end{array} \) \# function: vertical_line \# input: a shift value and a height value (both integers) \# processing: generates a single vertical line of the desired height. the Iine is \# offset from the left side of the screen using the shift value \# output: does not return anything \# function: two_vertical_lines \# input; a height value and a width value (both integers) \# processing: generates two vertical lines. the first line is along the left side of \# the screen, the second line is offset using the "vidth" value supplied \# output: does not return anything Here is a sample program that you can use to test your functions. The expected output is printed below the sample code: grint ('Herizontal larm, wideh =5:" ) horizonta1_line(5) peint D print ('Herizonta] Iine, wideh =10=7 ) horizonta1_line\{10i perint D print L"Hacizontal 1 inse width = 15:"] hotizontal_1 if {15 i print D print ["Vertical Lint, shift =: height =3:"} vertital_line (0, 3) print D print ( 'Vertleal Linh, shift =3: helght =3: ") Yettical_line i3. 3) print 0 grint ('Yettieal Line, akift =6; height =5:7 vertiral_line[t, 5] print 0 grint ('Two Yertienl Lines, beight =3; width =3:7 ) tro_rertical_lines {3, 3) print D print ITw Yertical Linee heiaht =4: midth =5:7 two_vertical_lizes 4 , 5) perint D print ITwo Yertical Linex, teinht =5;width =2z7 ? two_Fertcal_1ines(s, 2) Horizontal line, width =5: Horizontal line, width =10 : Horizontal line, vidth =15 : Vertical Line, shift =0; height =3 : Vertical Line, shift =3; height =3: Vertical Line, shift =6; height =5 : Two Vertical Lines, height =3; width =3 : Tvo Vertical lines, height =4; width =5 : Two Vertical Lines, height =5 : width =2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
