Day 1 HW: Due Day 2. (many problems/parts have
answers
in the back (including a few without *s). I expect you to get
these right! Or ask in class for
sure if you don't understand them.)
p. 28ff: 3, 4, 5, 9, 11
In C++:
A: Add 3.5 (a floating point type) and
2 (an integer type). What do you get? Does it matter how
you
do the adding?
B: Does this run? If not, what does
it tell you? If it does run, what is the result? [fix my
C++
grammar if needed]
char a
a= 'h'
a = a + 1
cout << a
(Extra: what does 'z' + 1 give?)
Notes: (additions to, comments on text)
Bit: Smallest unit of information (BInary) 1/0, on/off, yes/no,
true/false, high/low. Usually represent as 1/0 for computer.
A set of 8 bits in a row = a byte (enough for one
character), 4 bits (half a byte)
= a nybble.
Next: I want to move us into the programming
environment
as quickly as possible, so we will do a repeating "spiral" through
chapters
2, 3, 4, 5--taking a concept you know from C++ (Ch. 2) into the data
representation
(Ch. 3) , machine (Ch. 4) and assembly environments (Ch. 5), then back
for another C-based concept.
First concepts: Integer (unsigned) and character representation,
Binary, Hex, Decimal
Next: Warford, Ch. 2: 2.1, pp. 33-40. Focus on Data types
(global/local variables a little later)
Ch. 3: 3.1 p.87-92 (Unsigned integers) and 3.4 p.
109-115 (ASCII)