CS173: Intro to Computer Science - Number Systems

Activity Goals

The goals of this activity are:
  1. To identify the number systems that represent common data types
  2. To model colors according to their RGB encoding

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 take notes for the group, and appoint another member to discuss your findings with the class. After class, think about the questions in the reflective prompt and respond to those individually. 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: ASCII Table

ASCII Table

Questions

  1. What is the decimal representation for the character 'A'? How about the newline character \n?
  2. What is the decimal representation for the character 'B'? How about the character 'b'? What is the difference between them?
  3. What is the difference between each corresponding capital and lowercase letter?
  4. Write out the representation for the character 'B' in binary, and also the character 'b'. How does their binary differ?
  5. How do you think a boolean isLowerCase(char x) function might work?

Model 2: RGB Colors

Visit this page: https://www.rapidtables.com/web/color/RGB_Color.html

Questions

  1. What three colors are used to define all colors on the color wheel?
  2. What does every greyscale color have in common?
  3. If you have one, what is the RGB value of your favorite color (or choose any color!)? What is the value of the red, green, and blue components in hexadecimal? What is the value in the "#" box for this color?
  4. What is the largest and smallest value of red, green, and blue that you can have?
  5. Given the number of possible reds, greens, and blues, how many total colors can we represent?
  6. Including black and white, how many possible pure greyscale colors can we represent?

Submission

Submit your answers to the questions using the Collaborative Spaces section of OneNote. You can add a page with your name and your group members' names, and today's date, as the title. Under the appropriate section (i.e., "Class Notes", "Collaborative Spaces", "Reflective Prompts") that you can select on the left side of the screen, you can click "Add Page" on the right side. You can answer any reflective prompt questions in the Reflective Journal section of your OneNote Classroom personal section.