CSCI 255 Lab Assignment 1

Due date

This assignment must be submitted as a single file dplot.c for Lab Assignment 1 of the Computer Science 255 lab section on UNCA moodle by 5:00 PM on Friday, 27 February.

The Task

Significantly extend the program written for the C programming II lab so that it will print out a nicely formatted table of distance values.

Here is an example of a run of a successful program for accomplishing this task.

Enter X co-ordinate for object: 3.1416
Enter Y co-ordinate for object: 201

Now enter the X and Y range values for the table.
  Lower bound for X: 100
  Upper bound for X: 105
  Lower bound for Y: 300
  Upper bound for Y: 306

                100        101        102        103        104        105
     300   138.5011   139.2023   139.9071   140.6154   141.3273   142.0427
     301   139.2176   139.9152   140.6164   141.3213   142.0296   142.7415
     302   139.9377   140.6317   141.3293   142.0306   142.7355   143.4438
     303   140.6611   141.3516   142.0457   142.7435   143.4448   144.1497
     304   141.3879   142.0749   142.7655   143.4598   144.1576   144.8590
     305   142.1181   142.8015   143.4886   144.1794   144.8738   145.5717
     306   142.8515   143.5314   144.2151   144.9024   145.5933   146.2878

The Rules

The only file you are allowed to modify in the original lab distribution is dplot.c, the main program. This means that your program must confirm to the strict C compilation flags defined in Makefile.

Your program must make a neatly formatted table.

Your program must accept floating point numbers or integers for the x and y values of the "object". It must accept only integers for the x and y range values.

Your program must terminate gracefully if the user inputs inappropriate values.