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
Give five examples of top level domain​
coldgirl [10]

Answer:  .com — Commercial businesses.

.org — Organizations (generally charitable).

.net — Network organizations.

.gov — U.S. government agencies.

.mil — Military.

.edu — Educational facilities, like universities.

Explanation:

5 0
3 years ago
Read 2 more answers
In database software, which option is the most appropriate menu choice or command to use if you want to change the format of the
sleet_krkn [62]

Answer:

I think it's d

Explanation:

             

4 0
3 years ago
What is the basic process of programming?
NikAS [45]

Answer:

There are usually three stages to writing a program: Coding. Compiling. Debugging.

8 0
3 years ago
Targeted attacks are easier and take less time and effort than attacks on targets of opportunity.
Mnenie [13.5K]

Answer:

False

Explanation:

Targeted attacks are usually harder because if someone has a password that is 1234 and you try it on 100 computers, you most likely will get someones password. If you are targetting a select computer with a strong password it is much harder to brute force or guess.

8 0
3 years ago
Though there are no specific federal laws for cyberbullying, in some cases cyberbullying
inessss [21]
Cyberbullying overlaps with discriminatory harassment
7 0
3 years ago
Other questions:
  • Which of the following blocks is least similar to the others?
    8·2 answers
  • Suppose you want your firewall to block all incoming Telnet connections but to allow outbound Telnet connections. One approach w
    9·1 answer
  • Why is the radial gradient type a good choice for the grapes?
    13·2 answers
  • how can you create fades with the smart tool? How can you specify the types of fade curves that are used with the smart tool?
    13·1 answer
  • Ebba received a message from one of her tech support employees. In violation of company policy, a user had downloaded a free pro
    14·1 answer
  • In a Microsoft® Word® document, if a user wanted to organize information in rows in columns, they should select a
    5·1 answer
  • Who developed the idea of a universal network?
    11·1 answer
  • Review universal data models and discuss how these are being used more widely today. Does a data modeling project using a packag
    9·2 answers
  • "What line of code can be used to provide a convenient way to merge the source code from one file with the source code in anothe
    8·1 answer
  • Write a program that will add up the series of numbers: 99, 98, 97… 3, 2, 1. The program should print the running total as well
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!