In this lesson our instructor. Alvin Sylvain talks about more types. He discusses unions, union of struct, union rules, enumerators, use of typedef, custom type substitution, and pointer hiding. Then he lectures on cautions using underlying types, cautions using time_t Typedef, 'const'Ness, const on Object Attributes, and mutable
Create a structure that contains the pertinent attributes like an “Auto” class that isn’t derived from any other class.
“union” that structure to an array of characters.
Set the various structure elements to interesting values, and print them out. Also print out the characters from the union’ed array of characters to see what they look like at a closer to the “machine level.”
Define an “enum” type for the weekdays (there’s seven of them, right?)
Define an array of strings for each weekday so you’ll be able to print them out.
Define an “enum” of error severities for use in the exception handling in your “Auto” program.
Use the “typedef” keyword to define these types so you can use them again in other programs. E.g., you should be able to define a variable as a “Weekday” type.
Write a function that takes the “Weekday” type as a parameter. Test the parameter in a “switch” statement, and if it equals:
Sunday or Saturday, print out “Week-end! Yaay!”
Monday, print out “Stormy Monday, Booo”
Wednesday, print out “Hump day”
Friday, print out “PAYDAY! YAAAY!”
Then anything you choose for Tuesday and Thursday.
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.