CISC105 Spring 2006 Lab04 CISC105 Spring 2006 Lab04

Programs

  1. 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.

  2. Copy part 1 and add a loop in main to call the function three times. (Which kind of loop would be appropriate?)

  3. 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.

  4. 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.