1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Usimov [2.4K]
3 years ago
5

Write a C++ program that prompt the user to enter the coordinate of two points (x1, y1) and (x2,y2), and displays the slope of t

he line that connects the two points.
Computers and Technology
1 answer:
kvasek [131]3 years ago
4 0

Answer:

#include<iostream>

using namespace std;

int main(){

   float x1,x2;

   float y1,y2;

   float slope;

   cout<<"Enter the value of first point(x1,y1): ";

   cin>>x1>>y1;

   cout<<"\nEnter the value of second point(x2,y2): ";

   cin>>x2>>y2;

   slope = (y2-y1)/(x2-x1);

   cout<<"Slope is: "<<slope<<endl;

}

Explanation:

First include the library 'iostream' for perform the operation of input/output.

after that, write the main function and declare the variable of points.

use the output command 'cout' for display the message on the screen.

use the input command 'cin' for store the value enter by user into the variable.

after that, use the formula to find the slope:

slope=\frac{(y_{2}-y_{1})}{(x_{2}-x_{1})}

Note: All values declare in the code is float type means decimal value. but you can enter integer value as well.

finally, cout is used to display the output slope on the screen.

You might be interested in
Images are available in many formats, such as tif, bmp, gif, jpeg, and ____.
Lerok [7]
<span>Images are available in many formats, such as tif, bmp, gif, jpeg, and png.

</span>Hope that helps.
7 0
3 years ago
The answer is family and friends
nadya68 [22]
Family and Friends



you said the answer was that, soooooo
5 0
3 years ago
Read 2 more answers
Write the HTML code to make the text "Learn Magic" link to a page called "magic-tricks.html".
Sedaia [141]

Answer:

Explanation:

Distract the audience from the real code by pretending to use silly faces, gestures, or different ways of asking the question as a code. Do the trick two or three times, then stop so the audience doesn't guess your secret. You can also talk to your assistant again and come up with a different code for next time.

4 0
4 years ago
What is the name of an instruction that interrupts a program being executed and requests a service from the operating system
tresset_1 [31]
“Interrupt” is what I think the answer is
7 0
2 years ago
The methodology used by web project teams is usually:
Tamiku [17]
The SDLC would be the usually used methodology by web project teams. Also known as the systems development life cycle, this kind of application development process is primarily used in information, computer, and software engineering which involves planning and testing applications.
5 0
3 years ago
Other questions:
  • 1. What is the main factor that affects Earth’s average temperature?
    12·1 answer
  • A customer survey asked respondents to indicate their highest levels of education. The only three choices in the survey were hig
    15·1 answer
  • what type of machine is a ramp for wheelchairs? compound machine, mechanical, machine complex machine, simple machine
    15·2 answers
  • Which sentence(s) below are true?a. IP stands for Internet Protocol.b. In most home networks IP addresses are assigned by the In
    6·1 answer
  • What does a computer need from people in order to solve problems effectively?
    9·1 answer
  • What is a computer and what is the work of it​
    5·2 answers
  • A student registers for a course in a university. Courses may have limited enrollment i.e a student must
    5·1 answer
  • Module 1 and 2 Coding Guided Notes Fill in your answers to each response as you read through the lesson pages in the coding cour
    11·2 answers
  • What is the answer to 4.9 Code Practice: Question 2
    14·1 answer
  • season is when the weather is not optimal and few tourists of vacation time a shoulder b high c average d low​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!