← Back

Code Challenge 1.8 - Line Slope Calculator


Introduction

When graphing lines in Algebra, it’s important to understand how to calculate the slope of a line. To calculate the slope, at least two points must be identified. You can then calculate the slope using the Slope Formula. The Slope Formula is defined as:

Slope Formula

where m is the slope, the ordered pair (x1, y1) is the first point, and the ordered pair (x2, y2) is the second point.

Skills to Practice

Challenge Tasks

Sample Output

Enter x1: 2 [Enter]
Enter y1: 3 [Enter]
Enter x2: 12 [Enter]
Enter y2: 14 [Enter]
The slope of the line is 1.1