Back to DFS's C Page


OAC Problem Set VI

Dynamic Memory Allocation #2

Before attempting this problem, read over and understand the Sample Program on the Dynamic Memory Allocation page.

Write a program which will read in a list of coordinates of unspecified length and store them in a linked list of dynamically allocated structures. Treat the points as defining a closed figure.

Find all pairs of vertices which define sides which have either zero slope or undefined slope. The last pair of coordinates and the first obviously define one of the sides.

In reporting your findings, print the name of the file read and print the coordinates of each pair of vertices and the slope of the side in a labeled table. Program Sample

To help you check your work, you may use the Plane Figure Drawing Program. Be sure to also download the icon bitmap file and place it in an appropriate directory.

This program will display the closed figure on a pair of axes, such as in the sample to the right.

When you are ready to have your program graded, print a listing and ask the teacher to run the test file(s).


Created 17 Feb 99
© DFStermole 1999