1. (Practice) Assume the following definition has been made:
union
{
  double rate;
  double taxes;
  int num;
} flag;
For this union, write cout statements to display the members of the union.



2. (Practice) Define a union variable named car containing an integer named year, an array of
10 characters named name, and an array of 10 characters named model.



3. (Practice) Define a union variable named factors that allows referencing a double-precision
number by the variable names watts and power.



4. (Practice) Define a union data type named Amt containing an integer variable named intAmt,
a double-precision variable named dblAmt, and a pointer to a character variable named ptKey.



5. (Desk check) a. What do you think the following section of code will display?
union
{
  char ch;
  double btype;
} alt;
alt.ch = 'y';
cout << alt.btype;



b. Include the code in Exercise 5a in a program, and run the program to verify your answer to
Exercise 5a.