Assignment 1 for CSCI 201

Description:

In this assignment you are asked to do both a written and a programming assignment. Both assignments are due at the start of class two weeks from the date that this assignment is given.

Written Assignment (show all of your work):

  1. Convert the following base 10 numbers to base 2 (binary) using 8 bits to represent each binary number:
    1. 135
    2. 76
    3. 13
  2. Convert the following base 10 numbers to a two's complement representation using 8 bits for each number:
    1. -7
    2. -99
    3. -100
  3. Compute the following products and sums in binary (show only as many bit as necessary to perform the calculation and represent the answer):
    1. -6 + 6
    2. 5 x 4
    3. 11 - 10
  4. Exercise 2.7 on page 96 of your text.
  5. Exercise 2.15 on page 97 of your text.

Programming Assignment:

Write the C++ program described in exercise 2.32 of your text. Calculate the sum of the five integers prior to calculating their average. Be sure to use good programming style; the programs in the book demonstrate good programming style.

What to turn in:

You should turn in the following at the start of class two weeks from the assignment date: