Course and Reading
Material
Weeks 1-2: Lecture
Introduction to Computers
No Class on Friday, August 30 and Monday, Sept 2 (Labor Day)
Home Quiz and Home Lab:
Home Ethics Quiz and Home Paper Reading Assignment
Decimal to Binary
Storing Characters
Steganography Example - Practice
Decimal/Binary
Converter
Wolfram|Alpha: Computational
Knowledge Engine
Decimal ASCII Chart
Weeks 1-2:
Reading Homework
Chapter 1: 1.1 - 1.4
Material for Mini Quiz 1 Friday Sept 6
- Chapter 1 (1.1 - 1.4)
- Conversion from decimal to binary (method of your choice)
- Conversion from binary to decimal
Mini Quiz 1 Structure
- Two questions
- Question 1: Convert binary number to decimal. Explain your answer
- Question 2: Convert decimal number to binary using the method of your choice (2 methods are
explained in class). Write your answer as 1 BYTE number ( 1 BYTE = 8 BITS) Explain your answer
- Range of the numbers is: 0 - 255
- CANNOT use: computers, calculators, cell phones, textbooks, notes (see below what is allowed).
The only allowed open material - ONE PAGE ( 2 sides) of your own written or
ptinted notes.
Exampes
- Convert binary number 1100 1101 to decimal
Solution: add power of 2 that corresponds to the bits that are ON ( bits that are equal 1):
128 + 64 + 8 + 4 + 1 = 205
Final answer: 205 is decimal equivalent of binary number 1100 1101
- Convert decimal 38 to binary:
Solution Method 1:
128 fits into 38? NO b7 = 0
64 fits into 38? NO b6 = 0
32 fits into 38? YES b5 = 1
38 - 32 = 6
Continue with 6:
16 fits into 6? NO b4 = 0
8 fits into 6? NO b3 = 0
4 fits into 6 YES b2 = 1
6 - 4 = 2
Continue with 2:
2 fits into 2? YES b1 = 1
2-2 = 0
Continue with 0:
1 fits into 0? NO b0 = 0
Final answer: Decimal number 38 in binary is 0010 0110
Method 2 using Integer Division and Remainder:
38 / 2 = 19 remainder 0 b0 = 0
19 / 2 = 9 remainder 1 b1 = 1
9 / 2 = 4 remainder 1 b2 = 1
4 / 2 = 2 remainder 0 b3 = 0
2 / 2 = 1 remainder 0 b4 = 0
1 / 2 = 0 remainder 1 b5 = 1
As soon as we got 0 the process is stopped and the rest of the bits are 0: b6 = 0, b7 =0
Final Answer: Decimal number 38 in binary system is: 0010 0110
- Convert binary number 0100 0100 to decimal
Solution: add power of 2 that corresponds to the bits that are ON ( bits that are equal 1):
64 + 4 = 68
Final answer: 68 is decimal equivalent of binary number 0100 0100
- Convert decimal 121 to binary:
Solution Method 1:
128 fits into 121? NO b7 = 0
64 fits into 121? YES b6 = 1
121 - 64 = 57
Continue with 57
32 fits into 57? YES b5 = 1
57 - 32 = 25
Continue with 25:
16 fits into 25? YES b4 = 1
25 - 16 = 9
Continue with 9
8 fits into 9? YES b3 = 1
9 - 8 = 1
Continue with 1
4 fits into 1? NO b2 = 0
2 fits into 1? NO b1 = 0
1 fits into 1? YES b0 = 1
Final answer: Decimal number 121 in binary is 0111 1001
Method 2 using Integer Division and Remainder:
121 / 2 = 60 remainder 1 b0 = 1
60 / 2 = 30 remainder 0 b1 = 0
30 / 2 = 15 remainder 0 b2 = 0
15 / 2 = 7 remainder 1 b3 = 1
7 / 2 = 3 remainder 1 b4 = 1
3 / 2 = 1 remainder 1 b5 = 1
1 / 2 = 0 remainder 1 b6 = 1
As soon as we got 0 the process is stopped and the rest of the bits are 0:b7 =0
Final Answer: Decimal number 121 in binary system is: 0111 1001
Week 3:
Chapter 1 SAMPLE Review Questions - Mini Quiz 2 (Friday Sept 13) Preparation
Week 3
Reading Homework for Mini Quiz 2 (Friday Sept 13)
Chapter 1: 1.1 - 1.4
Review Questions (Preparation for mini-quiz on
Friday): pp.24 - 27
Exercises: (Preparation for mini-quiz on
Friday): #3, 4,
5
Mini Quiz 2 Structure and Material:
- Question 1: Encode short word (2-3 letters) into binary. Explain ONE letter in detail.
- Question 2: Decode short binary sequence into sequence of characters (3-4 letters). Explain ONE BYTE in detail.
- Question 3: Question checking reading homework - Chapter 1: 1.1 - 1.4 only
- CANNOT use: computers, calculators, cell phones, textbooks, notes (see below what is allowed).
The only allowed open material:
- ONE PAGE (2 sides) of your own written or
ptinted notes
- ASCII TABLE (will be provided).
Example 1: Convert Go! to binary
Solution: Go! in ASCII is: 71 111 33
71 to binary:
71/2 = 35 b0 = 1
35/2 = 17 b1 = 1
17/2 = 8 b2 = 1
8/2 = 4 b3 = 0
4/2 = 2 b4 = 0
2/2 = 1 b5 = 0
1/2 = 0 b6 = 1
71 in binary: 0100 0111
111 in binary: 0110 1111
33 in binary: 0010 0001
Final answer: Go! in binary: 01000111 01101111 00100001
- Example 2: Decode: 01101101 01000101 00110010
Solution: converting each BYTE to decimal
0110 1101 adding powers of 2 that are ON: 64 + 32 + 8 + 4 + 1 = 109
0100 0101 is 69
0011 0010 is 50
Original message in ASCII 109 69 50
Final answer: decoded word: mE2
Week 4:
Reading
Chapter 1: pp. 18 - 25
Chapter 2: 2.1 - 2.7
Checkpoint questions on page 20
Review Questions for Chapter 2 (Preparation for mini-quiz on
Friday Sept. 20)
Algorithm Workbench 1 - 9 (will be done in the lab):
(Preparation for mini-quiz on
Friday Sept. 20)
Mini Quiz 3 Structure and Material:
- Consists of 3 questions, similar to Checkpoint questions on page 20, Review and Algorithm Workbench Questions at the
end of chapter 2
- CANNOT use: computers, calculators, cell phones, textbooks, notes (see below what is allowed).
The only allowed open material:
- ONE PAGE (2 sides) of your own written or
ptinted notes
- ASCII TABLE (will be provided).
Week 5:
Reading Homework
Chapter 2 - all sections (2.1 - 2.8)
Review Questions for Chapter 2 (Preparation for Mini Quiz on
Friday Sept 27)
Programming Exercises for Chapter 2 (Preparation for Mini Quiz on
Friday Sept. 27
)
Algorithm Workbench Chapter 2(Preparation for Mini Quiz on
Friday Sept. 27)
Friday, Sept 27 - Mini Quiz
Material:
CANNOT use: computers, calculators, cell phones, textbooks, notes (see below what is
allowed). The only allowed open material:
ONE PAGE (2 sides) of your own written or
ptinted notes
TEST 1 on Friday, Oct 4
Material for TEST 1 includes Chapter 1, Chapter 2
TEST 1 Structure
- Duration: 50 minutes
- Place: In class
- Material:
- CANNOT use: computers, calculators, cell phones, textbooks, notes (see below what is allowed).
The only allowed open material:
- ONE PAGE (2 sides) of your own written or
ptinted notes
- ASCII TABLE (will be provided).
Part I: 3 questions to write the output of the program that is given to you and explain
your answer
Part II: 1 question to write short program. Program is similar to the programs that
you will write during LAB on Monday and during practice lecture sessions, and similar to
examples from your textbook. This
part will use chapter 1 and chapter 2
material only.
Test 1 Preparation
Homework - Due Monday, Oct 7 -
Chapter 2 Program 10 p. 78-79
Week 7:
Reading Homework
Chapter 3
Review Questions for Chapter 3
Programming Exercises for Chapter 3
Algorithm Workbench (page 113)
Mini Quiz on Friday, October 11 will include WRITING ONE PROGRAM
using FUNCTIONS. YOU WILL USE COMPUTER TO WRITE YOUR PROGRAM. And at
10:47 you will send your program by e-mail - this process will be
done with my help
Homework for Week 7: Due Day Wed Oct 16:
Write a function FtoC that converts Fahrenheit temperature to
Celsius temperature.
The equation for converting a Fahrenheit to Celsius is:
Celsius= (5/9)*(Fahrenheit - 32)
Write a function CtoF that
converts Celsius
temperature to the correspondent Fahrenheit
temperature.
The equation for converting a Celsius temperature to
Fahrenheit is
Fahrenheit=(9*Celsius/5)+32
Write a program that asks user to enter Fahrenheit temperature for TWO
days
and finds the corresponding Celsius
temperatures for these two days. Then the program will ask user to enter
Celsius temperature for TWO days and
finds the corresponding Fahrenheit temperature for these TWO days.
Week 8:
Reading Homework
Chapter 4: 4.1 - 4.5
Review Questions for Chapter 4
Programming Exercises at the end of Chapter 4
Algorithm Workbench at the end of Chapter 4
No Mini Quiz on Friday, Oct 18
Lab Assignment on Monday, Oct 21
TEST 2 - October 25, 2013
TEST 2 Preparation
and Structure
Week of October 28 Schedule
- Monday, Oct 28 - Graded Lab
- Monday Oct 28 Homework posted - program 8, page 154 - Due Day, Monday Nov 4, 10 am in class
- Wed Oct 30 - Regular Class
Friday, Nov 1 - NO CLASS!!! HOME MINI QUIZ. Will be e-mailed Th night, Due Day: Friday 5 pm
Future Plans:
- Test 3 - Nov 8
- Test 4 - Nov 22
TEST 3 on Friday, Nov 8
Material for TEST 3 includes Chapter 2, Chapter 3, Chapter 4 and Chapter 5(!!!)
Weeks 9-12:
Reading Homework
Chapter 4
Chapter 5: 5.1, 5.2, 5.4 (Table 5.1, Table 5.2), 5,5 (Sentinels)
Loop WHILE PRACTICE
LOOP WHILE practice
1
LOOP WHILE
practice
2
LOOP WHILE practice
3
Test 3
Preparation
Test 4
Preparation
Additional Test 4 Preparation Practice
- Write a program that reads one positive integer and finds the sum and the
average of the digits.
- Trace this program for the following inputs: 234, 6723
- Add input validation USING LOOP to your program and trace it for the folowing input(pay
attention the following sequence is ONE input): -34 -678 1903