Question: 40 Write a program that draws two lines in an 80x80 static 2D array. The output of the program should be similar to the
40 Write a program that draws two lines in an 80x80 static 2D array. The output of the program should be similar to the figure shown below (except for the labels and axes used for illustraton). Two lines partion the 2D array into 4 pieces. The array values should be 1,2,3,4 in different partitions. The program should be executed as: >/twolines 3 10-0.5 6 Here the command line arguments are the line parameters: m,C1,m2, C (i.e. slope and offset of each line) k=1,2. y=mx+ck * The center of the array (i.e., ij coordinates: 40,40) should correspond to origin (0,0) of (x,y) space. Array indices (ij) should be related to x&y accordingly. The program should print the array values on screen. TY (0,0) 33333333 13330 3333 1333 3093 ** 3333 1933* 9339 13303 X 2 do
Step by Step Solution
3.48 Rating (151 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
