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...
-
What role does feedback play in a system?
-
In Exercises find the coordinates of the point. The point is located in the yz-plane, three units to the right of the xz-plane, and two units above the xy-plane.
-
What are the important goals and considerations of information security?
-
Select a company you are interested in and obtain its annual reports by going to the companys website. Download the annual report for the most recent year. (On many companies websites, you will need...
-
6 a. Show by induction on n that 12 +22 +32 +...+n = n(n+1)(2n+1) b. Let T(n) be defined recursively as follows: T(1) = c, and T(n) = 5T (#)+c vn5 C. where c is an arbitrary constant, and n = 5k for...
-
Comparative financial statement data of Stow Optical Mart follow: Other information: 1. Market price of Stow Optical Mart common stock: $122.91 at December 31, 2018, and $165.75 at December 31, 2017...
-
A retail shop sells surgery face mask since the lock down in March 2020. Assuming that the weekly demand for the face mask is a Poisson variable with mean 10 boxes. Stocks are replenished only at the...
-
Define competition. What are the different types of competition?
-
What is environmental scanning? Why is environmental scanning so important? Who conducts the environmental scan, and how is one conducted?
-
Explain how Minskys financial fragility hypothesis captures the interaction of emotional and psychological influences and their impacts on financial structure. What are the potential consequences for...
-
Describe the different demographic trends of interest to sports marketers. How will these demographic trends influence the strategic marketing process?
-
Your universitys athletic program has a number of competitors. List all potential competitors and categorize what type of competition each represents.
-
Compliance with legal and regulatory requirements is: A. a security decision B. a business decision C. an absolute requirement D. conditional and based on cost
-
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...
-
Why does spreading feet apart help a surfer stay on the board?
-
Why will a projectile that moves horizontally at 8 km/s follow a curve that matches the curvature of Earth?
-
How much speed does a freely falling object gain during each second of fall?
Study smarter with the SolutionInn App