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
kupik [55]
3 years ago
10

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

ine that connects the two points.
Computers and Technology
1 answer:
zzz [600]3 years ago
3 0

Answer:

Here is code in C++.

//include headers

#include <bits/stdc++.h>

using namespace std;

//main function

int main() {

//variables to store coordinates

float x1,x2,y1,y2;

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

// reading coordinate of first point

cin>>x1>>y1;

cout<<"Please Enter the coordinate of second point (x2,y2): ";

// reading coordinate of second point

cin>>x2>>y2;

//calculating Slope of the line that connects these points

float m=(x2-x1)/(y2-y1);

cout<<"Slope of the line that connects these two points is :  "<<m<<endl;

}

Explanation:

Declare four variables x1,x2,y1,y2 to store the coordinate of both points.

Read the coordinate of both the point from user. Calculate the slop of the

line which connects these two points with the formula m=(x2-x1)/(y2-y1).

Output:

Please Enter the coordinate of first point (x1,y1): 1 3                                                                                                        

Please Enter the coordinate of second point (x2,y2): 5 12                                                                                                      

Slope of the line that connects these two points is :  0.444444  

You might be interested in
20 points!!!!! Help, I am being timed!!!!!!!
jarptica [38.1K]

Answer: XML files that contain the code that to be inserted, elements that control its behaviour and metadata such as the author's name.

Explanation:

3 0
1 year ago
Which of the following actions should you take when turning left at an intersection?
fomenos
The answer is B Okay good luck and dont...mess it up
8 0
3 years ago
What software tool can you use to see the applications that are currently running?
Soloha48 [4]

Answer:

You can use the task manager to see what programs are currently running.

Explanation:

7 0
2 years ago
Read 2 more answers
I need help in Jumbotron: Paragraph. The question is:
Aleksandr-060686 [28]
<span>.jumbotron p
{
color: #fff;
font-size: 20px;
}</span>
6 0
2 years ago
The ____ is the period of time within which systems, applications, or functions must be recovered after an outage. Select one:
scZoUnD [109]

Answer:

c. recovery time objective                                                  

Explanation:

  • Recovery time objective (RTO) is the maximum acceptable duration permitted between an unfortunate loss or failure and the restoration of normal operations and services.
  • According to the RTO, the systems, applications or operations must be restored within a targeted time period after a disaster, to avoid unacceptable outcomes of the disruption.
  • So a business process must be recovered within this period of time.
  • It measures how much a failure affects the normal operations, applications and systems and RTO is measures in time units like seconds minutes hours or days.
  • In simple words RTO refers to the time you need to restore system, applications and data.
  • For instance a 2-hour RTO refers to restore and get operations or services back to running within 2 hours of the service failure or outrage.
6 0
3 years ago
Other questions:
  • If a router receives a packet and it does not have an entry in its routing table for the destination network, it will send the p
    13·1 answer
  • Provide the instruction type, assembly language instruction, and binary representation of instruction described by the following
    7·1 answer
  • "A user reports that the corporate web server cannot be accessed. A technician verifies that the web server can be accessed by i
    8·1 answer
  • Does access provide email communication
    13·1 answer
  • jakie krasnale mieszkaja we wroclawiu i opisz kto napisal kronike, prosze nie kopiowac dlugich tekstow najlepiej by bylo opisac
    6·1 answer
  • Which tool allows users to share code and also serves as a social networking
    10·1 answer
  • How does the autosum command calculate data? Need help ASAP​
    5·1 answer
  • HW2.24. Statement: Area of a Triangle The area of a triangle can be computed by knowing the base and height of the triangle usin
    11·1 answer
  • Look at the slide.
    10·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!