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
Python - Write a program to print the multiplication table as shown in the image by using for loops.
Galina-37 [17]

Answer:

Explanation:

The following python code creates the multiplication table for 10 rows and 10 columns. This code uses nested for loops to traverse the table and print out the product of each multiplication. The image attached shows the output of the code.

for x in range(1, 11):

       for y in range(1, 11):

           z = x * y

           print(z, end="\t")

       print()

8 0
3 years ago
I'll pay 50 dollars to anyone who can do this leave your snap after answering doing it and ill cash app it
gladu [14]

Well for must cases it is the Ram of the system and the processor I will show you how you can get rid of slow processing

  1. Run the task manager then try to stop some running programs
  2. the antivirus sometimes slows the computer due to the processing power it takes.
  3. I would recommend that all program should be closed from the task manager and close some running apps in the system settings go to start up and then close it now you are good to go.

5 0
3 years ago
Web browsers are used to browse the world wide web.
VikaD [51]
No its actually used for looking up concerns, questions, or rumours
3 0
4 years ago
Read 2 more answers
Why do computers need system software?
Marina86 [1]
<span>Computers don't need system software. System software is used to automate many tasks so the user can achieve more. Actually, one of the ideas of computer programming is to avoid needless repetition. The system software will prepare the computer for the user.</span>
5 0
3 years ago
1. Paying attention to the trends that might impact your future career is called
amm1812
The answer is A futurecasting.
8 0
4 years ago
Read 2 more answers
Other questions:
  • Suppose a digital camera has a storage capacity of 256mb. how many photographs could be stored in the camera if each consisted o
    8·1 answer
  • What is a interesting topic that is related in media and culture
    8·2 answers
  • When using Microsoft word, what would happen to the text of a paragraph if the "Justify" option is used?
    9·1 answer
  • Which of the following statements about certificates is true?
    14·2 answers
  • Catastrophic injuries and illnesses account for two-thirds of total health care costs in the country of Gnut. The Gnuti governme
    15·1 answer
  • You want to use a computer to make a painting of your backyard to go along with a story you wrote. Which software would be appro
    8·1 answer
  • An app ________ is a website that provides access to specific mobile apps that can be downloaded either for a nominal fee or fre
    14·1 answer
  • What is a saved link to a particular web page?​
    7·1 answer
  • Why, during the final stage of the multistage model for e-commerce, is comprehensive customer information captured in the suppli
    7·1 answer
  • Completar Fill in the blanks with the correct familiar commands. dar (negative) 1 of 1 Question 2 with 1 blank hacer (affirmativ
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!