CISC105 Spring 2006 Lab04
CISC105 Spring 2006 Lab04
- Write a program for each of the following problems. Be sure to
save every separate program. All programs must be properly commented
and indented (see Assignment Standards on the class website).
- Back up your files! Do you ever really read this stuff? Or am I
just writing to the wind? Sometimes important information is
here. Actually, it is all important to your success in the
course. The sample midterm questions are in the resources directory
of the class website.
- Before you get to lab, read through the practice exam questions
so you can ask your TA about anything you are unsure of.
- Name each program lab04.n.c, where n is the number in the list
below. For example, the name of the file for the first will be
lab04.1.c. Put the files in your lab04 directory.
Programs
-
Write a program that has all three components needed for
function use that we discussed in class. (Can you name them?) The
function should simply print "hello world". There should not be
any printing done directly from main.
- Copy part 1 and add a loop in main to call the function
three times. (Which kind of loop would be appropriate?)
- Use a shell command to copy the previous program. Place a loop around the function call in main so that the function is called once each time a number is entered until the user enters a sentinel of -1.
-
Write a new function that asks the user for a number and prints
it out once. Call that function from main.
You should have a total of 4 programs named lab04.1.c to
lab04.4.c. Make a single script file (see lab00 for the
instructions) where you cat, compile, and run each one in its final form.
Submit all 4 program files and your script on WebCT, and give the paper version of the
complete script file only on paper to your TA
at the beginning of your next lab (Wednesday labs submit
Friday at the beginning of class). Note: Cat, compile, and run each
program in order! Do not cat all programs, then compile, etc.
File translated from
TEX
by
TTH,
version 3.38.
On 7 Mar 2006, 23:46.