Test 1 CSCI 130
Summer 2003
- Please answer each question fully, carefully and thoughtfully.
- No credit will be given for unreadable answers, please write neatly.
- Answer the questions in any order, but please number each answer.
- Make sure that your name is on your test.
- (4 points) What is an algorithm? How is an algorithm used to produce
a working program?
- (6 points) Describe the function of an operating system, compiler and
editor.
- (6 points) Give the rules for constructing an identifier. Give
an example of an identifier that violates each of the rules.
- (2 points) Give an example of code that is self documenting.
- (8 points) Describe the four basic types that we have studied so far.
Give an example of each.
- (4 points) Give the basic outline of a c++ program.
- (10 points) Write a complete c++ program that given three numbers,
finds and prints the average of those numbers.
- (10 points) Write a complete c++ program that given a three letter
word, stored in a string, prints the word out backwards. (You will probably
need to use the substr(s,l) where s is the start of the substring and l is
the length of the substring).