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
A video streaming website uses 32 bit integers to count the number of times each video is played. In anticipation of some videos
Over [174]

Answer:

c) 2^32 times as many values can be represented.

Explanation:

It's funny, this problem comes from a real-life situation, except it wasn't really foreseen :-)  And we will encounter a similar problem in less than 20 years.

The difference in terms of storage capacity from 32-bit integers and 64-bits integers is huge.

A 32-bit integer can store (signed) numbers up to 2,147,483,647. (so over 2 BILLIONS)

A 64-bit integer can store (signed) numbers up to 9,223,372,036,854,775,807 (9 BILLIONS of BILLONS)

5 0
3 years ago
Read 2 more answers
What is the most efficient way to include a space after each paragraph
3241004551 [841]

To skip a line, then write the rest like this!


See? Good spacing, right?

4 0
3 years ago
You want to discard your old computer and want to securely erase the data from your hard drive. What can you use to do this and
qwelly [4]
Go here this should help bunches!
http://www.microsoft.com/security/online-privacy/safely-dispose-computers-and-devices.aspx
Hope this website helps!
5 0
3 years ago
Which role involves designing and creating advertisements for marketing purposes?
satela [25.4K]

advertising designers

5 0
3 years ago
A user is experiencing slow performance with their computer. A technician suspects the computer has a virus and runs antivirus s
IceJOKER [234]

Answer:

The answer is "Option A"

Explanation:

Escalation is the process of manipulating a bug, design failure in software program to obtain elevated access to the resources, which are usually shielded from the user, and wrong choices can be described as follows:

  • In option B, It is wrong because It can't provide any type of problem-solving.
  • In option C, It is wrong because it is a searching module.
  • In option D, It is wrong because it is used to verify the system.
6 0
3 years ago
Other questions:
  • Which three phrases describe a wireframe
    12·1 answer
  • Three variables, x, y and z, supposedly hold strings of digits, suitable for converting to integers. Write code that converts th
    7·1 answer
  • Find the simple interest Jay owes on a five-year student loan of $48,000 with an annual interest rate of 5%.
    6·1 answer
  • What are the two basic classes of active directory objects?
    14·1 answer
  • Knowing the meaning of the acronym WAS I WHY can be most helpful to you when you?
    14·1 answer
  • Which actions are available in the Trust Center? Check all that apply.
    8·1 answer
  • URGENT HELPP<br> WILL MARK BRAINLIST
    6·1 answer
  • Reesa works for a large real estate company. She is responsible for installing and supporting the company's internet systems, in
    5·1 answer
  • There are some games that cannot be described by a single--or even two-- genres. Can you think of any that should be invented?​
    6·1 answer
  • Explain information technology ?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!