Q1. Write a function called get_point(x,y) that asks to input x and y doubles coordination of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Q1. Write a function called get_point(x,y) that asks to input x and y doubles coordination of a point from the keyboard and returns their values. Q2. Write a function called quadrants(x,y) that determine and display to the screen in which quadrant is the point. The function should also return one value based on the point position. return 0 for origin (0,0), return 1 for point in first quadrant (positive, positive) return 2 for point in second quadrant (negative, positive) return 3 for point in third quadrant (negative, negative) return 4 for point in fourth quadrant (positive, negative) return 5 for point on x axis return 6 for point on y axis Q3. Write a function called slope that takes x and y coordination of two points as inputs and return the slope of the line that connect them. Check if the slope of line is undefine then print out an error message and return 999. Note: slope of a line = ²-₁ X2-X1 Q4. Illustrate these functions from the main function by (See sample outputs below) a. getting the coordination of three points (x1, y₁), (X2, y2), (X3, Y3). b. determining in which quadrant each point lies. c. finding the slope of the line connecting first and second point and display it to screen. d. Also determine and display to the screen if the third point lies on the same line that connect the first and second point. Q1. Write a function called get_point(x,y) that asks to input x and y doubles coordination of a point from the keyboard and returns their values. Q2. Write a function called quadrants(x,y) that determine and display to the screen in which quadrant is the point. The function should also return one value based on the point position. return 0 for origin (0,0), return 1 for point in first quadrant (positive, positive) return 2 for point in second quadrant (negative, positive) return 3 for point in third quadrant (negative, negative) return 4 for point in fourth quadrant (positive, negative) return 5 for point on x axis return 6 for point on y axis Q3. Write a function called slope that takes x and y coordination of two points as inputs and return the slope of the line that connect them. Check if the slope of line is undefine then print out an error message and return 999. Note: slope of a line = ²-₁ X2-X1 Q4. Illustrate these functions from the main function by (See sample outputs below) a. getting the coordination of three points (x1, y₁), (X2, y2), (X3, Y3). b. determining in which quadrant each point lies. c. finding the slope of the line connecting first and second point and display it to screen. d. Also determine and display to the screen if the third point lies on the same line that connect the first and second point.
Expert Answer:
Answer rating: 100% (QA)
1 include using namespace std void getpointint x int y Prompt for x and y cout xy int main xy variab... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
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...
-
A. What is Alpha One's NOPAT? Why does NOPAT differ from the earnings after taxes? B. Estimate the effective before-tax cost of the long-term debt. c. Estimate the effective after-tax cost of the...
-
Jacquie Boynton was just hired as the assistant treasurer of Key West Stores. The company is a specialty chain store with nine retail stores concentrated in one metropolitan area. Among other things,...
-
For the bridge network in Fig. 3.86, find Io using mesh analysis? Figure 3.86 6 kS2 30 v (+ L. 4 k2
-
What is the purpose of a declaration?
-
Calvin uses fraud to induce Maria to promise to pay money in return for goods he has delivered to her. Has a contract been formed? If so, what kind? What are the rights of Calvin and Maria?
-
This specific discussion will center around the evils of every economy. Locate an article about one of these topics. Topics: inflation and unemployment You may not use anything from social media. My...
-
Change all of the numbers in the data area of your worksheet so that it looks like this: A 1 Chapter 3: Applying Excel 2 3 Data 4 Allocation base 5 Estimated manufacturing overhead cost 6 Estimated...
-
Solve each equation by finding square roots. 12: 5x2 80 15. 9x 25 = Solve each equation. 19. x + 6x + 9 = 1 18. Fitness A rectangular swimming pool is 6 ft deep. One side of the pool is 2.5 times...
-
For the exponential family of distributions defined in (4.41), show (a) \(E(y)=\frac{d}{d \theta} b(\theta)\). (b) \(\operatorname{Var}(y)=a(\phi) \frac{d^{2}}{d \theta^{2}} b(\theta)\). (c) Assume...
-
This problem illustrates why exact inference may not behave well when conditional on continuous covariates. (a) Consider the following equation where \(a_{1}, a_{2}, \ldots, a_{n}\) are some known...
-
(a) What is the speed of light in vacuum expressed to three significant digits? (b) What is the square of the speed of light in vacuum expressed to three significant digits? (c) Is the numerical...
-
Let \(e_{t}\) denote the error term in a time series regression. We wish to compare the autocorrelations from an AR(1) error model \(e_{t}=ho e_{t-1}+v_{t}\) with those from an MA(1) error model...
-
Recent experimental values for the universal gravitational constant, the mass and mean radius of Earth, and the standard gravitational acceleration are Assuming a spherical Earth, these quantities...
-
What is the house that the narrator is taken to in Dickinson s poem? a . Her own home b . Heaven c . Her grave d . Hell
-
You are standing on the top of a building and throw a ball vertically upward. After 2 seconds, the ball passes you on the way down, and 2 seconds after that, it hits the ground below. a. What is the...
-
A sphere has a radius of 24 cm. A rectangular prism has sides of a, a/2, and a/ 4. (a) Determine a of a prism that has the same volume as the sphere. (b) Determine a of a prism that has the same...
-
Create a column vector with 9 equally spaced elements in which the first element is -34 and the last element is -7. (A column vector can be created by the transpose of a row vector.)
-
Make a plot of the ice cream cone shown in the figure. The cone is 8 in. tall with a 4 in. diameter base. The ice cream at the top is a 4 in. diameter hemisphere. A parametric equation for the cone...
-
What is the IQR? What does the IQR represent? The population parameters below describe the full-time equivalent number of students (FTES) each year at Lake Tahoe Community College from 19761977...
-
How many standard deviations away from the mean is the median? The population FTES for 20052006 through 20102011 was given in an updated report. The data are reported here. The population parameters...
-
A class of 20 students has a mean grade of 80 on a test. Nineteen of the students has a mean grade between 79 and 82, inclusive. a. What is the lowest possible grade of the other student? b. What is...
Study smarter with the SolutionInn App