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 two weeks from the
date that this assignment is given.
Written Assignment (show all of your work):
This assignment my be submitted electronically as describe below or it
may be submitted in hard copy at the start of class on the day it is
due.
- Convert the following base 10 numbers to base 2 (binary) using 8
bits to represent each binary number in two's complement format:
- 23
- 76
- 15
- -7
- -78
- -10
- Compute the following products and sums in binary (show only as
many bit as necessary to perform the calculation and represent the
answer):
- -8 + 8
- 5 x 4
- 12 - 11
- Exercise 2.7 and 2.8 on page 96 of your text.
Programming Assignment:
Write the C++ program described in exercise 2.20 of your text. The
output temperature should include fractional degrees when appropriate.
Be sure to use good programming
style.
What to turn in:
-
The answers to the written assignment may be submitted on paper at the
start of class, or they may be submitted electronically. If submitted
electronically to your class ftp directory, the file containing your
answers must be named write1 with the appropriate file
extension (e.g., the extension should be .txt if you created the file
using NotePad). Be sure to show all of your work.
-
The programming assignment must be turned in by transferring the C++
source code file to your ftp directory for this class. Only the
source code file (i.e., the file with the .cpp extension) should be
turned in, and that file must be named prog1.cpp. Use the
procedure demonstrated in lab01 to transfer the prog1.cpp to your ftp
directory. If you are working at home and don't have Netscape, click here for instructions on transferring your
file.