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
You want to use a terminal emulation program to terminal into a series of Cisco routers. You will be managing these devices remo
vampirchik [111]
If a terminal emulation program is used and the devices should be reotely managed, then you should use the Telnet protocol. <span>Telnet is a simple, text-based network protocol that is used for accessing remote computers over TCP/IP networks like the Internet. </span>It allows the user access<span> to a text terminal and all its </span>applications<span> such as command-line for example. </span>

7 0
3 years ago
A _______ is a collection of software routines that can be used by other software. Licensing terms for this type of software are
tensa zangetsu [6.8K]

Answer: library

Explanation:

A library refers to the collection of software routines that can be used by other software. Licensing terms for this type of software are important for programmers who use the software.

It is the collection of non-volatile resources that is used by computer programs, usually for the development of software.

8 0
3 years ago
True or False: If you take a course and do not pass it, you still get credit. I feel like it's false but i'm not sure. Can I get
Margaret [11]
Its true because even if you fail a course it shows on your transcript....

8 0
3 years ago
Read 2 more answers
When code is compiled it?
Marina CMI [18]

Answer:

To transform a program written in a high-level programming language from source code into object code. The first step is to pass the source code through a compiler, which translates the high-level language instructionsinto object code.

7 0
3 years ago
Read 2 more answers
What is the nearest ten cents of 453.56
Nutka1998 [239]

Answer:

453.6

Explanation:

It is 453.6 because you are rounding to the nearest ten cents place and in the number 453.56, 5 is in the ten cents place or the tenths place so you look at the number to its right, which is 6 and when you round, numbers 0-4 cause the rounding number to stay the same, numbers 5-9 cause them to go up one. In this situation, it is six so the number 5 would go up one, making it 6 and then you get rid of the numbers to the right side making it 453.6

3 0
3 years ago
Other questions:
  • A device that modulates digital data onto an analog signal and then demodulates the analog signal back to digital data is a ____
    8·1 answer
  • Should software companies be able to send automatic updates to your computer withoput your knowledge
    14·1 answer
  • There are two different perspectives in terms of how programs are delivered for different ethnic groups. If an agency offers dif
    14·1 answer
  • As the demand for goods and services decreases, job growth.
    14·2 answers
  • How many pieces are there in a normal laptop??? Good luck and solve carefully
    9·1 answer
  • 1. We want to add a button to the tally counter in Section 9.2 that allows an operator to undo an accidental button click. Provi
    8·1 answer
  • What do flowcharts communicate to programmers ?
    10·1 answer
  • What should be entered to make the loop print
    6·1 answer
  • Bits of information are combined into meaningful units so that more information can be held in short-term memory through the pro
    5·1 answer
  • PLEASE HELP<br><br><br> Write a pseudo code for an algorithm to wrap a gift.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!