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...
-
A hospital purchased 100 shares of stock on June 30, 2011, for $ 3,100, using its unrestricted resources. On December 31, 2011, the date of its financial statements, the stocks fair value was $...
-
Samson Corporation issued a 4-year, 75,000, zero-interest-bearing note to Brown Company on January 1, 2015, and received cash of 47,664. The implicit interest rate is 12%. Prepare Samsons journal...
-
Dr. Walter Sullivan was one of several plastic surgeons in Las Vegas visited by Julie Jones. Jones, an exotic dancer, sought plastic surgery to improve her ability to make money in her profession....
-
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...
-
Dr. Jose Rizals arrest, exile, trial, and eventual execution, primarily, was the result of his two books namely, Noli Me Tngere, and El Filibusterismo. However, his protagonist Crisostomo Ibarra,...
-
Using the Public MACRO BITCOIN scorecard spreadsheet (linked in its associated masterclass lesson - Long Term 32), create a COPY of it and perform a complete analysis for the date 22/2/2022....
-
Pass the necessary journal entry with narration. On June 1, 2008 , Fedex. issued 200,000 shares of $4 par value stock for $50 per share. Let’s record this transaction
-
List some of the strategic, planning, and operational decisions that an automotive manufacturer must make with regards to its supply chain.
-
Economies of scale are illustrated by a company declaring that they will not have sales, but will maintain very low prices all the time. the price of a taxi ride service increasing after 2am. a...
-
________ is used to determine customer service levels. Inventory held Backlog/stockout quantity Workforce hired/laid off Machine capacity increase/decrease
-
Use decision tree methodologies to value flexibility and make onshoring / offshoring decisions under uncertainty.
-
ASOS, a British online-only fashion and beauty retailer, sells its products from four main warehouses located in the United Kingdom, the United States, central Europe, and China. Marks & Spencer...
-
Midland Blues' 2022 balance sheet showed net fixed assets of $4,560,000, and the 2023 balance sheet showed net fixed assets of $5,210,000 million. The company's 2023 income statement showed a...
-
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?
-
What is a business strategy? Do you agree with the definition proposed? Illustrate your answer with examples.
-
Consider one of the following firms. Read the description of a business strategy in the text. Go to the firm's website and use it to gain an understanding of the business strategy. Look at elements...
-
Which quote at the front of the chapter do you find the most insightful? Why? Under what circumstances would its implications not hold?
Study smarter with the SolutionInn App