Homework E2

Due dates

This assignment must be submitted to the Moodle submission page for Homework E2 by 11:00 PM on Tuesday, 6 September. And, yes, that is the day after the Labor Day holiday.

The assignment

In this assignment you are going to read in a point in the plane and the following six pieces of information.

  1. The original point
  2. The point rotated 90°
  3. The point rotated 180°
  4. The point rotated 270°
  5. The point flipped horizontally (across the Y-axis)
  6. The point flipped vertically (across the Y-axis)

To make things a bit more interesting the points must be read and written inside parentheses. That is, the user enters the point as something like ( 3,  5.17). This is actually not hard to do with the scanf routine.

If the user enters the point incorrectly, your program is allowed to crash and burn.

Your program should produce nice looking output and it should also print your name.

Here's a run of my solution.

ECE 209 Homework E2
J Dean Brock

Enter the point:
 (  10000 , -17.1239798712 )
Point                 ( 10000.000,    -17.124)
Rotated  90 degrees   (    17.124,  10000.000)
Rotated 180 degrees   (-10000.000,     17.124)
Rotated 270 degrees   (   -17.124, -10000.000)
Flipped horizontal    (-10000.000,    -17.124)
Flipped vertical      ( 10000.000,     17.124)