Workshop
The Workshop provides quiz questions to help you solidify your understanding of the material covered and exercises to provide you with experience in using what you’ve learned. Try to answer the quiz and exercise questions before checking the answers in Appendix E and be certain that you understand the answers before continuing to the next lesson.
Quiz
What is the difference between a signed integer and an unsigned integer?
Why should you not use #define to declare a constant?
Why would you initialize a variable?
Consider the enum below. What is the value of Queen?
enum YourCards {Ace, Jack, Queen, King};
What is wrong with this variable name?
int Integer = 0;
Exercises
Modify enum YourCards in Quiz Question 4 to demonstrate that the value of Queen can be 45.
Write a program that demonstrates that the size of an unsigned integer and a normal integer are the same and that both are smaller in size than a long integer.
Write a program to calculate the area and circumference of a circle where the radius is supplied by the user.
In Exercise 3, if the area and circumference were to be stored in integers, how would the output be any different?
BUG BUSTERS: What is wrong in the following initialization?
auto age;