Exercise 7
• Write a C++ program to calculate and display the slope
of the line connecting the two points with coordinates
(-12,2) and (14,6.5). The formula to calculate the
midpoint of two points are as follows:
• slope = (y2 – y1)/(x2-x1) ;
• Your program should use manipulators to display your
slope value in the following format (with 2 decimal
places and left justified):
• The value of the slope is xxx.xx
1
Exercise 7
2
x1, y1
(-12,2)
x2,y2
(14, 6.1)
-12 14
6.5
2

More Related Content

DOCX
ws1 Linear Equation
PDF
Differential equation( list 02)
PDF
Calculus 45S Slides May 14, 2008
DOCX
Ninth grade 4th period study guide key
PPTX
Graph of a linear function
DOC
Extreme values
PDF
log and algebra rules
DOC
Review First Period Exam
ws1 Linear Equation
Differential equation( list 02)
Calculus 45S Slides May 14, 2008
Ninth grade 4th period study guide key
Graph of a linear function
Extreme values
log and algebra rules
Review First Period Exam

What's hot (11)

PPTX
Graphing Functions and Their Transformations
DOC
Chapter 1 review
PDF
7th pre alg -l55
PDF
Alg March 24, 2009
DOC
PDF
[Sbp] trial spm sbp_2013_maths_paper2_[a]
PPT
L6 continuity
PPTX
Integrals
PPTX
Graph of quadratic function
PPTX
Sifat Operasi Hitung
PDF
Skema mt-k2-pp-spm-t5-2017-set-a
Graphing Functions and Their Transformations
Chapter 1 review
7th pre alg -l55
Alg March 24, 2009
[Sbp] trial spm sbp_2013_maths_paper2_[a]
L6 continuity
Integrals
Graph of quadratic function
Sifat Operasi Hitung
Skema mt-k2-pp-spm-t5-2017-set-a
Ad

Viewers also liked (7)

PPTX
Javasession7
PDF
Introduction to-c-using-net
PPTX
Exercise6 ch2
PPT
9781111530532 ppt ch04
PDF
Java session 3
PPTX
Javasession6
PPTX
Javasession4
Javasession7
Introduction to-c-using-net
Exercise6 ch2
9781111530532 ppt ch04
Java session 3
Javasession6
Javasession4
Ad

More from IIUM (20)

PDF
How to use_000webhost
PDF
Chapter 2
PDF
Chapter 1
PDF
Kreydle internship-multimedia
PDF
03phpbldgblock
PDF
Chap2 practice key
PDF
Group p1
PDF
Tutorial import n auto pilot blogspot friendly seo
PDF
Visual sceneperception encycloperception-sage-oliva2009
PDF
03 the htm_lforms
PDF
Exercise on algo analysis answer
PDF
Redo midterm
PDF
Heaps
PDF
Report format
PDF
Edpuzzle guidelines
PDF
Final Exam Paper
PDF
Final Exam Paper
PDF
Group assignment 1 s21516
PDF
Avl tree-rotations
PDF
Week12 graph
How to use_000webhost
Chapter 2
Chapter 1
Kreydle internship-multimedia
03phpbldgblock
Chap2 practice key
Group p1
Tutorial import n auto pilot blogspot friendly seo
Visual sceneperception encycloperception-sage-oliva2009
03 the htm_lforms
Exercise on algo analysis answer
Redo midterm
Heaps
Report format
Edpuzzle guidelines
Final Exam Paper
Final Exam Paper
Group assignment 1 s21516
Avl tree-rotations
Week12 graph

Exercise 7b s1 (1)

  • 1. Exercise 7 • Write a C++ program to calculate and display the slope of the line connecting the two points with coordinates (-12,2) and (14,6.5). The formula to calculate the midpoint of two points are as follows: • slope = (y2 – y1)/(x2-x1) ; • Your program should use manipulators to display your slope value in the following format (with 2 decimal places and left justified): • The value of the slope is xxx.xx 1