Design and implement a C++ program based on the concept of composition. The program represents lines...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Design and implement a C++ program based on the concept of composition. The program represents lines for computer graphic and each line consist of 2 points. Declare the class Point and Line to model the line and points in computer graphic in 2 dimensional space. Line object has an array of Point object as members. In term of classes relationship, Line class has Point class. Use the following driver function. You must not change the driver function and when executed it should produce the output listed below. Driver function int main() { Line oLine1("line1", 21, 3, 3,4); // connect p1(21,3) with p2(3,4) oLine1.showPointsInLine(); cout < < endl; Line oLine2("line2", 87, 13, 11, 40); // connect p3 (87,13) with p4 (11,40) oLine2.showPointsInLine(); cout < < endl < < endl;; Expected output The 2 points for linel are The 2 points for line2 are (21, 3) (3, 4) (87, 13) (11, 40) Design and implement a C++ program based on the concept of composition. The program represents lines for computer graphic and each line consist of 2 points. Declare the class Point and Line to model the line and points in computer graphic in 2 dimensional space. Line object has an array of Point object as members. In term of classes relationship, Line class has Point class. Use the following driver function. You must not change the driver function and when executed it should produce the output listed below. Driver function int main() { Line oLine1("line1", 21, 3, 3,4); // connect p1(21,3) with p2(3,4) oLine1.showPointsInLine(); cout < < endl; Line oLine2("line2", 87, 13, 11, 40); // connect p3 (87,13) with p4 (11,40) oLine2.showPointsInLine(); cout < < endl < < endl;; Expected output The 2 points for linel are The 2 points for line2 are (21, 3) (3, 4) (87, 13) (11, 40)
Expert Answer:
Related Book For
Process Dynamics And Control
ISBN: 978-0471000778
2nd Edition
Authors: Dale E. Seborg, Thomas F. Edgar, Duncan A. Mellich
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
PLEASE GIVE CORRECT ANSWERS Prove that the number of comparators in any sorting network is (n log n). [4 marks] (ii) What does Part (d)(i) imply in terms of the depth of any sorting network? [1 mark]...
-
Mr. CFE is the sole proprietor of a hardware store called, The CFE Shop. Mr. CFE has decided to incorporate the business but wishes to minimize any income inclusions on the transfer of his business...
-
Buckingham Ltd. purchases a delivery truck on January 1, 2012, at a cost of $86,000. The truck is expected to have a residual value of $6,000 at the end of its four-year useful life. Buckingham has a...
-
Two tanks contain steam and they are both connected to a piston/cylinder, as shown in Fig. P6.182. Initially the piston is at the bottom, and the mass of the piston is such that a pressure of 1.4 MPa...
-
The flowrate between tank \(A\) and tank \(B\) shown in Fig. P8.115 is to be increased by \(30 \%\) (i.e., from \(Q\) to \(1.30 Q\) ) by the addition of a second pipe (indicated by the dotted lines)...
-
1. How do the standards set by Fred Smith for FedEx teams improve organizational performance? 2. What motivates the members of FedEx to remain highly engaged in their teams? 3. Describe the role...
-
Write 4 paragraphs about 'modes of communication in Blackberry' with citation and references in APA style.
-
I used that data given and found that total sales are $3,079,015 and total accounts receivable is $1,015,353. I need help developing an accounts receivable aged trial balance for 2019 to determine if...
-
Bosco corporation uses a process costing system. Beginning inventory for January consisted of 1000 unites that were 60% completed. During january, 10,500 units were completed. On January 31, the...
-
what ways does environmental sustainability intersect with social change, and how can societies balance the urgency of environmental action with the need for social and economic stability ?
-
A local spatial average of a power delay profile is shown in Fig. 1. 0 dB -10 dB P,(x) -20 dB- -30 dB 0 Fig. 1 2 6. (s) T (i) Determine the rms delay spread and mean access delay for the channel....
-
Iva Chance is one of a group of workmates who have, over a period of months, shared the cost of purchase of a Lotto ticket each week. One of the workmates, Getta Munee, has always collected the money...
-
1. Consumer surveys suggest that the three most important qualities for retail consumers are price, product quality and selection, and convenience. Does Amazon Go provide all three of these qualities...
-
Spieth Company employees had the following earnings records at the close of the November 30 Bi-weekly payroll period. Name o the Employee Weekly hours Hourly Rate Scott 80 16.50 Quageber 70 18.50...
-
ABC company leased new advanced computer equipment to STU Ltd on 1 January 2019.STULtd has to pay annual rental of $290,000 starting at 1 January 2019. It is a four years lease with ultimate rental...
-
Appelpolscher and Arrhenius Quirk, head of IGC?s Chemical Kinetics and Reactor Design Group) are engaged in a dispute concerning the model developed earlier for the inadequately agitated reactor...
-
For Exercise 20.1, consider two sets of design parameters and simulate unit step changes in both the disturbance and the set point. Assume that the disturbance model is identical to the process...
-
The start-up procedure for a batch reactor includes a heating step where the reactor temperature is gradually heated to the nominal operating temperature of 75 o C. The desired temperature profile...
-
With diverse patient populations come language translation issues. Medical interpretation is a challenge facing most health organizations. Medical interpretation and translation services are costly....
-
Visit the Hofstede Centre (https://geerthofstede.com/culture-geerthofstede- gert-jan-hofstede/6d-model-of-nationalculture/) and review the scores by country for the various cultural dimensions that...
-
You have been asked to join the hospitals task force for developing a plan to increase the organizations workforce diversity from its current 20% level to 40% over the next 5 years. How does your...
Study smarter with the SolutionInn App