b) Create a class named triangle. It takes cartesian coordinates for 3 corners of a triangle....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
b) Create a class named triangle. It takes cartesian coordinates for 3 corners of a triangle. The constructor calls a set function that accepts three sets of coordinates and verifies that each of these is in the first quadrant with no single x- or y-coordinate larger than 30. Use the function distance() in part (a) to find the length of each side and then write a function named as area() to computer the area of triangle using following hero's formula. 73 6- A = √√√s (s-a) s(sa) (sb) (s — c) y 01 4- 3- 2- 1- 0 S (x₁, y₁) 1 d = c a+b+c 2 X₂ 2 - X₁ = a 3 4 (X2, Y₂) |y₂ - Y1 = b 5 (X2, y1) 6 +X 7 b) Create a class named triangle. It takes cartesian coordinates for 3 corners of a triangle. The constructor calls a set function that accepts three sets of coordinates and verifies that each of these is in the first quadrant with no single x- or y-coordinate larger than 30. Use the function distance() in part (a) to find the length of each side and then write a function named as area() to computer the area of triangle using following hero's formula. 73 6- A = √√√s (s-a) s(sa) (sb) (s — c) y 01 4- 3- 2- 1- 0 S (x₁, y₁) 1 d = c a+b+c 2 X₂ 2 - X₁ = a 3 4 (X2, Y₂) |y₂ - Y1 = b 5 (X2, y1) 6 +X 7
Expert Answer:
Answer rating: 100% (QA)
The following code is written in CPP language Code Pa... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Eight independently isolated mutants of E. coli, all of which are unable to grow in the absence of histidine (his), were examined in all possible cis and trans heterozygotes (partial diploids). All...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Suppose that Q(x, y) is a function such that 1/Q(x, y) is continuous for all (x, y). Which of the following statements are true? (a) Q(x, y) is continuous for all (x, y). (b) Q(x, y) is continuous...
-
When a quantity of monatomic ideal gas expands at a constant pressure of 4.00 X 104Pa, the volume of the gas increases from 200 X 10-3 m3 to 8.00 X 10-3 m3. What is the change in the internal energy...
-
Draw a graph to show the effect of the new technology in the market for loanable funds. Suppose that the business cycle in Canada is best described by RBC theory and that a new technology increases...
-
Nationwide Insurance developed a program to recruit new insurance agents by offering planning, training, and start-up financing to build self-sustaining agencies. These new agents would be...
-
The financial statements of Lioi Steel Fabricators are shown below, both the actual results for 2010 and the projections for 2011. Free cash flow is expected to grow at a 6% rate after 2011. The...
-
2) Rolf throws a small bouncy ball of mass 52.0 g with speed 15.1 m/s. The ball bounces off a wall, rebounding at 13.8 m/s. The ball is in contact with the wall for 2.25 milliseconds (2.25 ms). Find...
-
Bartov Corporation reports the following beginning inventory and purchases for 2020: Bartov sells 600 of these units in 2020. Compute its cost of goods sold for 2020 and the ending inventory reported...
-
Consider We Build Construction's latest project: We Build is developing a 1-story medical office building on available land near a hospital. The following table details the project's 8 work...
-
What strategies can be employed to handle the complexities of distributed concurrency control and synchronization, especially in scenarios with high contention and distributed data stores?
-
Zeus company factored P6,000,000 of accounts receivable to a finance entity at the beginning of current year. Control was surrendered by Zeus Company. The factor accepted the accounts receivable...
-
Dividend Yield The market price for Macro Corporation closed at $54.03 and $75 on December 31, current year, and previous year, respectively. The dividends per share were $0.67 for current year and...
-
Marissa has two credit cards. The first credit card has a credit limit of $ 1 9 , 5 0 0 , and Marissa has $ 1 9 , 0 0 0 of debt on that card. The second credit card has a credit limit of $ 1 7 , 5 0...
-
How do distributed monitoring and logging systems, such as Prometheus and ELK stack, facilitate observability and troubleshooting in complex distributed environments? Discuss their architecture and...
-
How do you plan an audit to reach a level of reasonable assurance?
-
You deposit $10,000 in a savings account that earns 7.5% simple interest per year. What is the minimum number of years you must wait to double your balance? Suppose instead that you deposit the...
-
a. You created an interactive StaffDinnerEvent class that obtains all the data for a dinner event for Carlys Catering, including details about the event and all the staff members required to work at...
-
A boolean variable can hold _____________. a. Any character b. Any whole number c. Any decimal number d. The value true or false
-
The method that determines whether two String objects are equivalent, regardless of case, is ____________. a. equalsIgnoreCase() b. toUpperCase() c. equalsNoCase() d. equals()
-
Use the Ritz variational method for the harmonic oscillator, with trial wave functions \(\psi_{1}(x)=\) \(e^{-y^{2} / 2}, \psi_{2}(x)=e^{-y^{2}}, \psi_{3}(x)=e^{-2 y^{2}}\), where \(y=x \sqrt{m...
-
Consider a two-level system, with basis \(|1angle,|2angle\), and in this basis, a Hamiltonian with elements \(\left(\begin{array}{ll}1 & 1 \\ 1 & 1\end{array} ight)\). Use the first form of the...
-
Use the practical variational method for the same harmonic oscillator ground state energy, with trial wave function \(\psi_{a}(x)=e^{-a y^{2}}\).
Study smarter with the SolutionInn App