Midterm Exam # 1 F96 KEY
MIS 304 Midterm Exam 10/11/96
Short Answer (10 points each):
1.) Please explain explicitly the difference between declaring a structure and defining a variable. Make sure you explain clearly what each does and why they are different. You may use the following examples in your explanation.
struct HelpMePlease {
char szWhyAmIHere[100];
float fVeryLowGPA;
int iHopeforaCurve;
};
int i;
A definition reserves memory a declaration does not. The declaration of HelpMePlease specifies a name and attributes but allocates no memory. The defintion of i (in int i) allocates 2 bytes of memory and identifies it with the symbol i.
2.) Using the above structure do only the following (DO NOT WRITE AN ENTIRE PROGRAM):
a. Define a single variable to store a char array, a float, and an int.
b. Initialize the variable with the following values: “In order to learn C++”, 1.25, 0
c. Display the stored values to the monitor.
a & b: HelpMePlease stOne = {“To learn programming”, 1.5, 0}; // You could also initialize them individually after defining the variable. For example stOne.fVeryLowGPA = 1.5;
c: cout ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- financial management exam 1 answers
- midterm exam prep pre test questions for class sessions
- psychology exam 1 quizlet
- developmental psychology exam 1 quizlet
- philosophy exam 1 quizlet
- sociology 101 exam 1 quizlet
- windows 8 1 activation key free
- sociology 101 exam 1 answers
- organic chemistry exam 1 practice
- introduction to sociology exam 1 quizlet
- psychology exam 1 practice test
- lifespan development exam 1 quizlet