Quizzes and Extra Credit for Week 2.
Post your answers to the Quizzes from Week 2 here rather than in the chapter thread, so as not to spoil things for the others.Chapter 3 Quiz 1. What is a variable? 2. What happens to a variable when the program terminates? 3. What purpose does the "label" or identifier serve with respect to variables? 4. What purpose does the type serve with respect to variables? 5. Is C++ a "Strongly typed" or "Weakly typed" language...what does that mean? 6. Does an integer require the same amount of memory each time a program is run on the SAME computer? 7. Does an integer require the same amount of memory on EVERY computer? 8. What can be stored in a 'char' variable type? Integers, characters, both? 9. How large is a 'char' variable usually 9. What are the usual sizes for 'short int', 'int', and 'long int' data types? 10. What does the C++ Standard say about the size of integers? 11. How big are integers on a 32bit x86 processor using a modern compiler? 12. What operator can you use to determine the size of a data type? 13. Are integers signed or unsigned by default? 14. What are the minimum and maximum values for signed and unsigned long integers (4 byte integer)? 15. [Extra Credit] Why are those the minimum/maximum values? That is, how does the C++ language treat signed vs. unsigned integers differently on a "binary" level? 16. Is C++ a case-sensitive language? What does this mean? Show some examples. 17. What are the Do's and Dont's of naming variables according to your textbook? 18. What operator do you use to assign a value to a variable? 19. Can you initialize a variable at the same time it is declared? What does this look like? 20. What does the "typedef" keyword do? Why is it useful? 21. When do you use short, int, or long? 22. What happens when you attempt to store a value bigger than a variable can hold? 23. What happens when you attempt to store a value smaller than a variable can hold? 24. What are the TWO things 'char' variables can be interpreted as? What is the relationship between these two things? 25. When must you initialize constants? 26. What is the difference between a literal constant, and a symbolic constant? Show some examples. 27. What are the two ways covered in this chapter for declaring a constant? Which is better? 28. How do you declare an enumeration? 29. [Extra Credit] Site some possible examples where an enumeration might be a useful data type.