[MWF] Principles Of Algorithm Design I  - CSCI  1320 Tentative Schedule - Fall 2000 [MWF] 
 Class 
Topic(s)
 Reading Assignments 
& Handouts
 Laboratory 
Assignments 
8/25
 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
clear
ls P*, ls *.jpg
cat
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/28
 UNIX Continued
yppasswd
cp
mv
rm
rmdir
vi
man 
cd
mkdir
rmdir
 Review & Practice UNIX commands
Practice Telnet
Review & Practice vi commands
 VI Lab
8/30
 man 
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
 
 Chapter 1

Mail Message

9/1
  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

 Read Chapter 2.1-2.3
 Numeration Systems Lab
Due 1 Week
9/4
Labor Day - No Class
 
 
9/6
         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
 
 
9/8
 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 
   { 
         ----------
         ----------
    } 

 Read Chapter 2.4 - 2.5
  Decision Lab
9/11
Operators *, /, +, -, %
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

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/13
 Quiz On Decisions
PostTest Loops
PreTest Loops
 
 
9/15
 Collect Notebooks
Review Loop Processing
Guess My Number Game
 Read Chapter 3.1-3.3
 Loop Lab
9/18
  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);

 
  PayRoll Lab
9/20
 Pass By Reference
Pass By Value

Scope Of Variables - Access

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

void DisplayInfo (short int ShapeNo,
float Height, float Base);

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

 Read Chapter 4.1-4.2
 PayRoll Lab
Due Friday By 4:30
MailBox
9/22
 Collect Notebooks
Quadratic Application
GetInfo
Calculate
Display
 
 
9/25
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

 
  Pizza Lab
9/27
 Revisit GuessMyNumber Game
long int Random(long int Low, 
long int High);

Void Functions
Practice Writing Functions
Revisit Pass By Reference & Valu

 
 
9/29
 Collect Notebooks
Functions With Explicit Returns
 
 PrimeNo Lab
10/2
 # 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();

 
 
10/4
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;

 Read Chapter 9.1-9.2
 Faculty File Lab
10/6
 Sets Of Related Array Elements
#define MAX_EXAMS 5
int Array[MAX_EXAMS];
int ActNoExams;

FillArrayFromFile

 
 
10/9
# include <stdio.h>
printf ("%s %d %ld %f\n",
string, int, long int, float);
scanf ()
gets(String)
 
 
10/11
 Review For Exam
 
 
10/13
 Exam I
 
 
10/16
 Arrays
Bowling
Exams
DisplayIntArray
FillIntArrayFromKeyboard
 
 
10/18
  -----------
 
 
10/20
 Fall Break
 
 
10/23
 Go Over Exam
Fill RandomArrayFromKeyboard
BubbleSort
 
  Array1 Project lab
Due Friday
10/25
 Introduction To Classes
Methods
Constructor
Destructor
Set
Display

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

 
 Book Class Lab
Due 11/3
10/27
 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/30
 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/3 
11/1
 Static vs Dynamic Arrays
Pros & Cons
 
  Project Array2 Lab
Due 11/13 
11/3
 Order N Square
Bubble Sort Algorithm
Bubble Sort Efficiency
Improving The Bubble Sort
 
 
11/6
 Recursion
Call Itself
General Case
Simpler Case
Factorial
 
 
11/8
 Recursion Continued
Stack
Local Variables
Passed Arguments
Fibonacci
Examples
Efficiency
 
 
11/10
 Programming Team
 
 
11/13
 Sting Processing
EOS Marker
ASCII values
strcpy
 
 
11/15
 Sting Processing Continued
strcmp
strcpy
strlen

2 Dimensional Arrays

 
 String Lab
Due 11/22 
11/17
 2 Dimensional Arrays
In-Class Lab
 
 Project Array3 Lab
Due 11/6

In-Class Lab
2D Arrays

11/20
 Sequential Search
Binary Search
 
 
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/328/342 (Will Move As Necessary)
11/22
 No Class - Help Session Monday
 
 
11/24
 Thanksgiving Break - No Classes
 
 
11/27
 
 
 
11/29
 
 
 
12/4
 Exam II
 
 
12/6
 Exam III
 
 
12/9 & 12/10
Reading Days
 
 
There Will Be A Final Project!  There Will Not Be A Comprehensive Final Exam During Exam Week!