This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: UNIT 04/REVIEW 1 TEST 1. Briefly Answer each of the following questions. a. What does #include do? b. What is Hungarian Notation? c. What is the difference between ++i and i++? d. Any statement in C++ that starts with a # is known as what? e. What happens if you try to take the modulo of two floats? a) #include tells the computer to include the code contained in the file. i.e. #include <iostream>, in this case you are telling compiler to include code contained in the file iostream. b) Hungarian Notation helps you keep your defined IDE unique from all the predefine IDE's in the C++. i.e. "int fArea = 0.0;" fArea is a Hungarian Notation. c) ++i is a Pre Assignment Increment, which will change the value of i immediately. i++ is a Post Assignment Increment which will change the value of i in the next statement. d) it is known as preprocessor directive. e) It gives you an error, because there is no remainder if you use float. 2. Assuming x equals -1, which of the following are TRUE. a. (true) && (x-4>=4) b. !(x<0) && (x>0) c. (x>0) || (x<0) d. (x>1) && (x++ > 1) e. (x!=1) != !(x==-1) f. (3.0/4.5*(28%6)) >= (2*3*sin(3.14156)*3/2.5) a) Fasle b) False c) True d) False e) True f) True 3. When a mass is rotating about an axis, there will be a centrifugal force 3....
View Full Document
- Spring '07