40 Write a program that draws two lines in an 80x80 static 2D array. The output...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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ğ 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ğ
Expert Answer:
Related Book For
Automation Production Systems and Computer Integrated Manufacturing
ISBN: 978-0132393218
3rd edition
Authors: Mikell P.Groover
Posted Date:
Students also viewed these algorithms questions
-
Write a program that draws two circles with radius 15 pixels, centered at random locations, with a line connecting the two circles. The distance between the two centers is displayed on the line, as...
-
Write a program that draws two filled circles with radius 15 pixels, centered at random locations, with a line connecting the two circles. The line should not cross inside the circles, as shown in...
-
Write a program that draws two filled circles with radius 15 pixels, centered at random locations, with a line connecting the two circles. The distance between the two centers is displayed on the...
-
World Information Group has two major divisions: print and Internet. Summary financial data (in millions) for 2011 and 2012 are: The annual bonuses of the two division managers are based on division...
-
The data related to Osage Sporting Goods Company's factory overhead cost for the production of 60,000 units of product are as follows: Productive capacity at 100% of normal was 80,000 hours, and the...
-
In the gameshow Lingo, the team that correctly guesses a mystery word gets a chance to pull two Lingo balls from a bin. Balls in the bin are labeled with numbers corresponding to the numbers...
-
All sales, for cash or on credit, can be recorded in the general journal. True/False
-
Complete the requirements for each of the following independent cases: Case A. Dr Pepper Snapple Group, Inc., is a leading integrated brand owner, bottler, and distributor of nonalcoholic beverages...
-
This is the entire question . D Question 3 1 pts Company B purchased equipment for $500,000 on January 1, 2010. It had an estimated useful life of 10 years and a salvage value of $50,000. While pr...
-
You are working on a free-form Packet Tracer challenge activity as seen in Figure 1, you have been given the London Railways network.' The purpose of this EMA question is to build upon each of the...
-
Interest paid to the holder of a municipal bond issued by the city of Los Angeles is not included in the holder's gross income in order to encourage people and entities to purchase municipal bonds...
-
2. (10 points) Recall our table for the Restaurant problem: Num Alt Bar Fri Hun Pat Price Rain Res Type Est Wait 888 French 0-10 $ S $ yes no Z1 Fr Is Iz To 27 Is yes no yes some yes full yes no no...
-
Mason ( single ) is a 5 0 percent shareholder in Angels Corporation ( an S Corporation ) . Mason receives a $ 1 8 2 , 5 0 0 salary working full time for Angels Corporation. Angels Corporation...
-
What are some key traits and qualities that define an effective leader in today's complex and dynamic business environment?
-
Sales are budgeted at $340,000 for November2019, $320,000 for December2019, and $330,000 for January2020. Collections are expected to be 85% in the month of sale, 14% in the month following the sale,...
-
Apply the Kahn's algorithm to solve the topological sorting problem for the following digraph. Present the topological order as you learned in the class. For the problem, you don't need to present...
-
Dorsey Company manufactures three products from a common input in a joint processing operation. Joint processing costs up to the split-off point total $385,000 per quarter. For financial reporting...
-
For liquid water the isothermal compressibility is given by; where r and b are functions of temperature only. If 1 kg of water is compressed isothermally and reversibly from I to 500 bar at 60(C. how...
-
A flexible manufacturing cell consists of a manual load/unload station, three CNC machines, and an automated guided vehicle system (AGVS) with two vehicles. The vehicles deliver parts to the...
-
A DAC uses a reference voltage of 80 V and has 6-bit precision. In four successive sampling periods, each 1 second long, the binary data contained in the output register were 100000, 011111, 011101,...
-
What is feed forward control?
-
10. CPA QUESTION In general, which of the following statements is correct conceming the priority among checks drawn on a particular account and presented to the drawee bank on a particular day? a....
-
11. Rev. Janet Hooper Ritchie knew that the shoe store at Buckland Hills mall in Manchester, Connecticut, would not accept a Discover credit card, so she stopped at an ATM for a $100 cash advance....
-
Go to http://www.legaldocs.com (or an equivalent site) and fill in the blanks of a promissory note. Who is the maker, and who is the payee of your note? Did you create a demand note?
Study smarter with the SolutionInn App