[TT] Principles Of Algorithm Design I  - CSCI  1320 Tentative Schedule - Fall 2000 [TT] 
 Class 
Topic(s)
 Reading Assignments 
& Handouts
 Laboratory 
Assignments 
8/24
 Introduction To Class
Distribute & Discuss Course Outline
Log Out Of UNIX - To NT
Log Out of NT To UNIX
Operating System
Telnet
janus01.cs.trinity.edu - 
ls, ls -l, ls -a, ls -al
yppasswd
cp
mv
rm
clear
ls P*, ls *.jpg
vi
cat
man 
ASCII
bit, byte
 Course Outline

Fill Out Questionnaire (Lab I-5 points)

Introduction To UNIX

Introduction To VI

Telnet Requires That You Set Up A UNIX Account
Same UserName - Different Password!
---------------------------------
Get Help Setting Up Mail Account 
(if not yet done)
Go To A University Lab - Log In
Select  Network Neighborhood
Select To Entire Network
Select  Microsoft Windows Network
Select CS
Select Sol
Check Mail - Password Will Be Mailed To You!
Have One of the CS Majors Help If Needed

If  Mailed Password Does Not Work
Contact Dr. Howland Halsell 201C (999-7364)

Telnet From Off Campus is Disabled!

 Questionnaire 
 

 UNIX Lab

 

8/29
cd
mkdir
rmdircat
man 
cd
mkdir
rmdir
vi commands
command mode
A, i
:5
Arrow Keys
x, 3x
dd, 3dd
2yy, P, p
arrow keys
ESC:wq
ESC:w
ESC:q!
/cout, /main, /{
:r FileName
G
Insert Mode
Keys, ESC

Operating System
Compiler
Source File
Object File
Machine Language
Assembly Language
Low Level Language
High Level Language

B - Thompson
C - Ritchie
C++ - Stroustrup

 Review & Practice UNIX commands
Practice Telnet
Review & Practice vi commands

Read Chapter 1

 VI Lab

Chapter 1

Mail Message

8/31
 Collect Notebooks
Motherboard
DIMM - SIMM
ROM/RAM
BUS
CPU

Information Representation
ASCII
char  (1 byte)
Binary Numeration System 
Base 2 (0,1)
Counting in Binary
short int (1+ byte)
int - (2+ bytes)
long int (4+ bytes)
Octal Numeration System
Base 8 (0,1,2,3,4,5,6,7)
Hexadecimal Numeration System
Base 16 (0,1,2,3,4,5,6,7,9,A,B,C,D,E,F)

Numerical Information Representation
Memory - short int
Sign Magnitude 
One's Complement
Two's Complement
Char - ASCII

No Calculators!
Convert Base 10 to Base 2
Convert Base 2 to Base 10
onvert Base 10 to Base 8
Convert Base 8 to Base 10

 
 Numeration Systems Lab
Due 1 Week
9/5
Power Supply
Hard Drive 
Track, Sector, Block

Review Conversion 
Convert Base 10 to Base 2 
Convert Base 2 to Base 10
Convert Base 10 to Base 8 
Convert Base 8 to Base 10
Convert Base 16 to Base 8 
Convert Base 16 to Base 2
Convert Base 2 to Base 16
Convert Base 8 to Base 16
Convert Base 10 to Base 16

Binary Adder Circuit
Addition
Sub- 2's Comp
Mult - Repeated Add
Div - Repeated Subtraction

 Read Chapter 2.1-2.3
Finish Numeration Lab 
9/7
 Collect Notebooks
Datatypes & Range & Size
float 7 digits
double 15 digits
long double 19 digits

char, string
int, short int, long int

5 Software Life Cycle
Analyze, Algorithm
Code, Test, Maintain

Decisions
if then
if then else
operators 
>, <, >=, <=, ==, !=

if ( condition)
      ----------

if ( condition)
      ----------
else 
      ----------
 

if ( condition)
   { 
         ----------
         ----------
    } 
else 
   { 
         ----------
         ----------
    } 
 

if ( condition)
   { 
         ----------
         ----------
    } 
else if ( condition)
  { 
         ----------
         ----------
    } 
else 
   { 
         ----------
         ----------

    } 

Modulus
representing mathematical
expressions

Escape Sequences \n, \a

display stream decimals
cout.setf(ios::fixed)
cout.setf(ios::showpoint)
cout.precision(2)

Compound Decisions
if ( (A == 5) && (B==6))
if ( (A < 5) || (B > 6))
if ( (A < 5) || (B ! = 6))

real division vs integer division
12/5
12./5, 12/5., 12./5.
float(12)/5, 12/float(5)
float(12)/float(5)
(float) 12) /5, 12/ (float) 5
(float) 12 / (float) 5

 Read Chapter 2.4 - 2.5
 Decision Lab
9/12
PostTest  Loop
do 
         ---------- 
while ( condition)

do 
   { 
         ----------
         ----------
    } 
while ( condition)

PreTest  Loop

while ( condition)
       ----------

while ( condition)
   { 
         ----------
         ----------
    } 

Fixed Repetition Loop

for ( init ---- ; condition ; loop ----)
       ----------

for ( init ---- ; condition ; loop ----)
   { 
         ----------
         ----------

    } 
 
 
9/14
 Collect Notebooks
Review Loop Processing
Guess My Number Game
 Read Chapter 3.1-3.3
  Loop Lab
9/19
 sqrt, pow, abs, labs, fabs, ceil, floor
math.h library

Bad Code Example

Transform Single Program 
Into Modular Program

Input From File
a.out < Data

AreaCalculation
void ClearScreen(void);
Prototypes

void Commercial(void);

void GetInfo (short int & ShapeNo,
float & Height, float & Base);

void Calculate (short int ShapeNo,
float Height, float Base,
float & Area);

void Add (int Addend1, int Addend2,
int & Sum);

Pass By Reference
Pass By Value

Scope Of Variables - Access

 
  PayRoll Lab
Due Friday By 4:30
MailBox
9/21
 Collect Notebooks
char Name[80];
Array of char

cout << "Enter Name: ";
 cin.getline(name, 80);

 cout << "Enter Name: ";
 cin.getline(name, 80);

GetInfo (float & Diameter, 
float & Cost, char Name[]);

Random Number Generation
rand()
# include <stdlib.h>
rand() % N
rand()/(INT_MAX + .0001)
0 <=  X < 1
int( rand() /(INT_MAX + .0001)
* NoEvents + Low)

INT_MAX       2147483647

Void Functions
Practice Writing Functions
Revisit Pass By Reference & Value

 Read Chapter 4.1-4.2
 
9/26
Revisit GuessMyNumber Game
long int Random(long int Low, 
long int High);

Function With Explicit Returns

 
 Pizza Lab
9/28
 Collect Notebooks
Functions With Explicit Returns
 
 PrimeNo Lab
10/3
 # include <string.h>
strcpy(Name, "Tom")

# include <fstream.h>
ifstream
          PartFile;
PartFile.open("Part.fil");
char
                     Name[20],
                                FileName[255];
PartFile.open(FileName);
PartFile.fail()
while (! PartFile.eof())
PartFile >> No;
   PartFile.getline(Name,20);
PartFile.close();

 Briefly Scan 
Chapter 5
  Faculty File Lab
10/5
Introduction To Arrays
int Nos[5];
Nos[0] = 5;

Sets Of Related Array Elements
#define MAX 5
int Array[MAX];
int ActNo;

#define MAX_BOWLING  21
int Array[MAX_BOWLING];
int ActNoBowling;

Sets Of Related Array Elements
#define MAX_EXAMS 5
int Array[MAX_EXAMS];
int ActNoExams;

FillArrayFromFile

 Read Chapter 9.1-9.2
 
10/10
 # include <stdio.h>
printf ("%s %d %ld %f\n",
string, int, long int, float);
scanf ()
gets(String)
 
 
10/12
 Collect Notebooks
 
 
10/17
 Exam I
 
 
10/19
 Go Over Exam
Fill RandomArrayFromKeyboard
FillIntArrayFromFile
DisplayArray
 
 Array1 Project lab
Due  Next Friday
10/24
 Introduction To Classes
Methods
Constructor
Destructor
Set
Display

Declare/Allocate Class Object
private data/methods
public data/methods

 
  Book Class Lab
Due 11/2
10/26
 More On  Classes
Methods
Constructor
Destructor
Set
Display

Declare/Allocate Class Object
private data/methods
public data/methods

Optional Arguments
Display(char Message[]="")
Constructor(int x=0, y=0)

 Read Chapter 6.1-6.2
 
10/31
 More On  Classes
Methods
Constructor
Destructor
Set
Display

Constructor Overloads
GetMethod
flushing the Input Streams

Static Array
int Nos[20];

Dynamic Array
int * Nos;
Nos = new int [20];
delete [] Nos;

 
  Computer Class Lab
Due 11/2
11/2
Order N Square
Bubble Sort Algorithm
Bubble Sort Efficiency
Improving The Bubble Sort
 
 Project Array2 Lab
Due 11/13 
11/7
 Recursion
Call Itself
General Case
Simpler Case
Factorial

Stack
Local Variables
Passed Arguments

 
 
11/9
 Recursion Continued
Fibonacci
Examples
Efficiency

Sting Processing
EOS Marker
ASCII values
strcpy

 
 String Lab
Due 11/21 
11/14
 Sting Processing Continued
strcmp
strcpy
strlen

2 Dimensional Arrays

 
 Project Array3 Lab
Due 12/5
11/16
 2 Dimensional Arrays
In-Class Lab
 
In-Class Lab
2D Arrays
11/20/00 - Optional Help Session : 2:30 - 4:30 
Review Recursion, Arrays, Classes, Files, etc. For Exam II
Come For Part Or All
Halsell 228 (Will Move As Necessary)
11/21
 
 
 
11/23
 Thanksgiving Recess
 
 
11/28
 
 
 
11/30
 Collect Notebooks
Exam II
 
 
12/5
 
 
 
12/7 & 12/8
Reading Days
 
 
There Will Be A Final Project!  There Will Not Be A Comprehensive Final Exam During Exam Week!
Last Day To Submit Late Work will be 12/7/00