Lab date: Wednesday November 29th.
Due Friday December 1st by 4pm.
These directions were posted Sunday, November 26th.
This will be a very simple lab, and quick to do (not like Lab 7!). It will give you some basic experience with using arrays, including passing them to functions and sorting arrays. It will also give you a chance to use reference parameters, which allow you to alter variables passed as parameters so that the values of those variables in the calling program are changed.
If the assignment above is just too simple for your tastes, try this:
Create a two-dimensional array of characters (Sec. 11.1) of size 20x20.
Initially, place a blank character in each element, for a total of 400.
Create a function that will "draw" a circle into the array by placing a '*'
at points around the perimeter. You can do this using a function such
as x = 10 + 8*cos(theta) and y = 10 + 8*sin(theta).
Just put these two equations in a for loop and use x and y as the integer
values of the index of the positions
in which to put the '*'. The loop could gradually increase value of theta
from 0 to 2*pi, in increments of pi/40 for example. When the array is
filled, print it out on a sequence of 20 lines. See pg. 116 for sin and cos.