This lab will give you practice with calling library functions (specifically some from the cmath library).
Write a program that helps the user calculate the distance between two points in the 2D Cartesian plane. Try to make your results as readable as possible.
As an example, you might have the program interaction look something like (the parts in this color are typed by the user):
$ ./distance.out Welcome to the 2D Distance Program!!! Where is your first point? 3.4 12.2 Where is your second point? 13.4 12.2 Thank you!! Calculating... Done. (3.4, 12.2) is 10 units away from (13.4, 12.2). Thank you for using the TDP!! Endeavor to have a wondrous day! $
This assignment is (Level 1.5).
Teachers are complaining that they wish students to use proper ordered pair notation for writing out points at all times but your program not only doesn't allow them to — but forces them not to! The students are stuck between a rock and a hard place (you can decide which you are and which the teacher is; *grin*). Many of them are becoming confused.
Add (Level 1) to make the user to enter the points in normal style. (i.e. a parenthesis, then the x value, then a comma, then the y value, then a closing parenthesis.)
The user interaction would now look something like (the parts in this color are typed by the user):
$ ./distance.out Welcome to the 2D Distance Program!!! Where is your first point? (3.4, 12.2) Where is your second point? (13.4, 12.2) Thank you!! Calculating... Done. (3.4, 12.2) is 10 units away from (13.4, 12.2). Thank you for using the TDP!! Endeavor to have a wondrous day! $
If you did all above options, this lab could be worth as much as (Level 2.5).