CSCI 201 Lab 9 -- Loops in C++
If a directory called C:\FILES\Lab09 presently exists on your computer, delete it.
Download a ZIP'ed copy of the Lab 9 projects
and store it in the C:\FILES directory.
Go into the MS-DOS prompt and execute the following commands:
This should create two new directories: TurnOn
and StopLight. You'll only use TurnOn.
- cd c:\files
- mkdir Lab09
- cd Lab09
- pkunzip -d ..\lab09.zip
Open, build, and run c:\files\Lab09\TurnOn\TurnOn.dsw.
Take a look at Funky.cpp.
This time you have to call a function
with a integer which gives the number of a square to paint red.
Your task and your instructor's checkoff
You are to write five functions that do the following:
||Turn on every third integer from 0 to 99.
||Turn on all squares (0, 1, 4, 9, ...) from 0 to 99.
||Turn on all powers of two (1, 2, 4, 8, ...) from 0 to 99.
||Turn on the first fifteen numbers that are divisible
by either three or seven.
||Turns on every number from 0 to 99
which divides into 8,393,022 without leaving a remainder,
that is, |
8393022/i is zero.
Return to CSCI 201 page
Return to the UNCA Computer Science home page