Test 1 CSCI 130
Fall 2016
- 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.
- Algorithms
- [3 points] Give the definition for an algorithm.
- [2 points] Describe why a programmer should develop and test an algorithm before beginning to code a solution.
- Program construction.
- [5 points] Give the code required for nearly all c++ programs.
- [1 point each] From the above code, give an example of each of the following program elements.
- Reserved word
- Standard identifier
- Preprocessor directive
- Comments
- [2 points] Why should a programmer include comments in a program? (You said to is not an acceptable answer).
- [2 points] What happens to comments when a program is compiled?
- [2 points] Describe the behavior for comments included in /* */.
- [2 points] Describe the behavior for comments beginning with //
- Data Types
- [1 point each] Name four different data types.
- [2 points] What is a data type?
- [4 points] Select one data type and explain or demonstrate why it is a data type. (This answer should contain all elements of the previous answer.)
- [3 points] What is a syntax error?
- [6 points] We have discussed two major software tools needed to produce a working program. Name the broad class of each and describe the task each performs.
- Programming Conventions
- [2 points] Give an example of a syntax rule.
- [2 points] Give an example of a programming convention.
- [2 points] Explain the difference between a syntax rule and a programming convention.
- [4 points] Why should a programmer follow a programming convention?