Your Name: ______

CISC 192 – Midterm

Many of the following questions ask you to create short programs. Please create just the programming to properly demonstrate the technique requested. Any additional programming will be subject to review as a part of your exam. Be as efficient as you can with your responses. Paste your programming code into the document under the problem request. Programming segments will be randomly tested. When descriptions and/or explanations are requested please respond in the space below the request. Make sure your name is on each page (just enter it in the header space of each page).

Be sure to use good form in your programming code – indent as appropriate and comment close braces. Use complete sentences when answering questions with proper grammar.

You may use any printed matter – either electronic or hard copy. You MAY NOT seek help from other people.

All midterms should be returned by midnight on Sunday.

Provide two UNIQUE characteristics for each of the following data types. (2 pts ea)

  1. integer –
  1. double –
  1. character –
  1. Boolean –
  1. Indicate the purpose of including the header files below. (2 pts ea)
  1. iostream -
  1. iomanip -
  1. List three considerations that must be dealt with when creating and using loop control structures. (3 pts)

Create a programming that demonstrates the proper use of the following control structures. NOTE complete programs are expected. Please do not combine the requested programming with programming for another structure. Be as efficient as practical in your code series. (5 pts ea)

  1. if – else
  1. while()
  1. do – while()
  1. for()
  1. switch() with three options
  1. List five considerations (or limitations) when creating an identifier (variable or function name) in C or C++. (5 pts)
  1. Create a program that executes the following function be sure to incorporate a prototype and two calls to the function – one assigns the result to a variable which is then printed and one which is called directly in an output line - (10 pts)

double addTwo (double number1, number2)

{

double result = 0.0;

result = number1 + number2;

return result;

}// End of double addTwo (double number1, number2)

  1. Describe the purpose of the parts of a function header. (6 pts)
  1. What is the purpose of a prototype? (2 pts)
  1. Explain the term operator hierarchy and why it is important in our programming. (5 pts)
  1. Describe the difference(s) between = and ==. Why are they NOT interchangeable? (4 pts)
  1. How can a Boolean variable be assigned a value? Give an example. (4 pts)
  1. What is the purpose of the following statement -- #include <iostream>? (4 pts)
  1. Create a short program that uses a data structure with 3 data members – a string, a double, and an integer. The program should prompt the user to enter data into each member, as appropriate, then print the data using the following <iomanip> utilities – fixed, set(), and setprecision(), as appropriate. (10 pts)

The preceding represents my own efforts. I have not consulted any other person by any means (electronically or personally). I recognize that the use of printed documentation is accepted for the purposes of this mid-term.

Signed (Type Your Name Here): ______

1