# Activity Goals

The goals of this activity are:
1. To explain the evolution of data types from a bit perspective
2. To explain the storage limitations of primitive data types
3. To compose primitive data types from bits

# Supplemental Reading

Feel free to visit these resources for supplemental background reading material.

# The Activity

## Directions

Consider the activity models and answer the questions provided. First reflect on these questions on your own briefly, before discussing and comparing your thoughts with your group. Appoint one member of your group to discuss your findings with the class, and the rest of the group should help that member prepare their response. Answer each question individually from the activity, and compare with your group to prepare for our whole-class discussion. After class, think about the questions in the reflective prompt and respond to those individually in your notebook. Report out on areas of disagreement or items for which you and your group identified alternative approaches. Write down and report out questions you encountered along the way for group discussion.

## Model 1: The Bitmap (BMP) File Format

### Questions

1. What types of primitives do you see in the BMP file format?

## Model 2: The IEEE754 Floating Point Standard

### Questions

1. What primitive data types do you see in this format?
2. What fields make up a single-precision floating point value?
3. What do you think changes to make a double-precision floating point value?
4. Why do you think floating point values suffer from rounding error? How can we compare two floating point values?
5. What is the bit representation for an int with value 11?

## Model 3: Complex Types

### Questions

1. What is the bit level representation for the Person type (with arbitrary values)?
2. How would the representation change if name was a char* in the Person struct or record? What is the advantage of this?
3. What is the bit level representation for the arr type (with arbitrary values)? How about mat (specifically, are there 3 rows or 3 columns)?

## Model 4: Weakly Typed Languages

### Questions

1. What is the type of n? How about pow?
2. What are some weakly typed languages?

## Model 5: Strongly Typed Languages

### Questions

1. What is the type of x? What is its value, and why? How can we correct this to obtain the value we want?
2. Given that other languages would compute 1/3 to 0.33333..., how would you define the concept of type coercion?
3. What are some strongly typed languages?
4. What is the purpose of the (int*) clause in the malloc statement? What does malloc actually return, and why?

## Model 6: Overloading Operators to Work with Complex Types in C++

### Questions

1. How might you use this to add two Time objects together?

## Submission

I encourage you to submit your answers to the questions (and ask your own questions!) using the Class Activity Questions discussion board. You may also respond to questions or comments made by others, or ask follow-up questions there. Answer any reflective prompt questions in the Reflective Journal section of your OneNote Classroom personal section. You can find the link to the class notebook on the syllabus.