COSC 1436 Exam 2 Review
The exam will be given on November 18, 2011 during regular class hours. You
will have 50 minutes to complete the exam. The exam will cover Sebesta Chapters
6 - 11. You will be allowed a one-page (both sides), handwritten, note sheet
for this exam.
Most of the exam questions will be of two types:
- Short Answer. You will be given a question on a programming language concept
and asked to explain your understanding of the concept.
- Problem. You will be given a problem, similar to what has been demonstrated
in lecture and in the problems
page. These problems will directly reflect what we have discussed in class.
Exam 1 Material. Exam 1 material will not be directly tested
as part of this exam, but everything that was covered for Exam 2 is built upon
the ideas and concepts we covered in Exam 1, and you will need to be able to
use this material.
Chapter 6, Data Types.
- What are primitive data types? What are the advantages and disadvantages
in using primitive data types?
- The IEEE Floating-Point standard is almost universally used in modern computers
and compilers. Understand the system from the conceptual level. What are some
of the problems with this system?
- The decimal data type is essential to business applications. What
are the primary characteristics of this system? What are the advantages and
disadvantages in using decimal data types?
- Understand the standards used to store character data (ASCII and Unicode).
Why is a 32-bit Unicode standard needed?
- What are the advantages and disadvantages of C/C++ C-strings compared to
a string class as used by almost all other languages? What are the typical
- What are the advantages and disadvantages of using special characters to
indicate a strings length?
- What are enumerated data types? What advantages do they have over
using integers to fulfill the same purpose? Be able to compare the C++ enumerated
data type with the C# enumerated data type.
- The text spends several pages evaluating array design issues. What are the
design issues the author discusses? Understand the key points the author makes
as he evaluates the different methods of handling arrays.
- Be familiar with associative arrays. What are the advantages of associative
arrays over regular arrays? How are associative arrays implemented in
C++ and C#?
- Have an opinion on unions and be able to support your opinion with
- Pointers play a critical role in computer science. Why do we need
pointers? Why then do some languages not allow pointers or strictly limit
- What are the design issues with pointers the author discusses?
- Type checking is critical importance in programming languages. Why?
Why then have some programming languages done away with almost all type checking?
Chapter 7, Expressions and Assignment Statements.
- Understand how operator precedence works in most programming languages.
Why has this system been adopted?
- Understand the operator associatively rules for expression evaluation.
Why has this system been adopted?
- What are functional side effects? What are the solutions available
that the author discusses?
- Operator overloading is a controversial subject. What are the issues? Be
able to take a stand either for or against and be able to support your position.
- Type conversions are part of most programming languages. What are the issues?
When should type conversions be allowed and banned? Be able to support your
- Programmers love compound operators and unary assignment operators,
while academic computer scientists hate them. Why does each feel so strongly
about its position?
Chapter 8, Statement-Level Control Structures.
- Know the basics of the if - then - else statement. How have different
computer languages implemented this control structure?
- There are many ways to include multiple-way selections in programming
languages. Be able to discuss the primary ways this is accomplished.
- Iteration is basic to all procedural programming languages. Understand
the control structures used in iteration and the advantages and disadvantages
- The for each statement is included in many languages. Why?
- The goto statement has a unique history in programming languages.
It is universally hated, but is still included in most programming languages.
What is the controversy? Why is it still included?
Chapter 9, Subprograms.
- Understand the basics of subprograms, including the basic definitions.
Why are subprograms critical to computer programming?
- What are the different ways that arguments are mapped to parameters? What
are the advantages and disadvantages of each method?
- Some programming languages allow default values to be used for parameters.
What are the advantages and disadvantages of allowing this?
- There are two primary categories of subprograms, procedures and functions.
What are the difference between them?
- The largest part of this chapter is spent on design issues for subprograms.
Understand the issues and be able to discuss the issues and how the different
programming languages handle these issues.
- Should overloaded subprograms be allowed? What are the issues?
- Most modern programming languages allow generic subprograms. Why are they
Chapter 10, Implementing Subprograms.
- Understand how subprograms are implemented using the simple model and the
the stack-dynamic model.
- What is contained in a typical activation record?
- Some programming languages allow nested subprograms? What are they
and what are the advantages and disadvantages?
- Most modern programming languages allow blocks within a subprogram.
What are they and what are the advantages and disadvantages?
Chapter 11, Abstract Data Types and Encapsulation Concepts.
- Understand the concept of abstraction and abstract data types as defined
by the author. Remember his definition is different than what has been typically
taught in this program.
- Why has data and program abstraction become so important to software development?
- What is the role of constructors and destructors in abstraction?
- Some programming languages use the concepts of friends. What role
does friends play in computer programming languages?
- What role does encapsulation play in abstract data types?