| Weekly Notes |
Topics |
Reading |
Assignments |
| Week 1 |
|
1.1-1.3, 2.1 (History and goals); 5.5 (Comments); 4.2 (Text_io);
6.1, 6.5 (Numeric types)
|
P1 is ready |
| Week 2 |
- A whirlwind tour of Ada
- numeric Input, procedures
- Let's write a program in groups: Read a low and a high value to define a
range, and then read a sequence of numbers, until eof, and count the number of
numbers below, in, and above the range. Calculate the percent in each group.
Assume the endpoints of the range are in the range.
Output, nicely formatted, the counts and percents.
Here's a solution (and prettified)
- Some examples from last semester:
- sumto10.adb: sum the ints from 1 to 10
- sumtoeof.adb: sum all the integers in a file of integers
- echochars.adb: print the characters in a file
- echocharsnl.adb: print the characters in a file, with newlines
- echocols.adb: print up to 5 columns of each line
- countvowels.adb: print the vowels in the input
- Exceptions - Let's do some exception handling
- Redirection: < for redirecting Standard Input, > for Standard Output
- Notes from last year:
|
Same as last week |
P1 is ready!
P2 ready too!
|
| Week 3 |
|
As last week + Procs: Chap. 9 + Exceps: 2.6, Chap 14
+ Arrays: 8.1-6, 2.4 |
P2 is here. Start NOW! |
| Week 4 |
Notes from last year:
|
Procs: Chap 9 |
P2 is here
P3 will be available soon.
|
| Week 5 |
|
Procs: chapter 9 |
Exam
Monday 2/23/09
P3 is here
|
| Week 6 |
- Exam Postponed:
- Records - Introduction
- Class exercise: Write a program that creates a list
of lines that are input.
- A list is an array with a maximum and current length.
- A line is defined by two points.
- A points is defined by 2 integers
- A partial solution: linelistpart.adb
- An almost complete solution: linelist.adb
- Notes from last year on arrays:
- Example 1: Get and print 10 ints in reverse:
print10.adb and
prettified
- Example 2: Print n ints in reverse:
printn.adb and
prettified
- Example 3: Print n ints in reverse, with procedures (ie get, put):
printnprocs.adb and
prettified
- Example 3: Print n strings in reverse, with procedures (type String is an Array of
Characters):
printnstrings.adb and
prettified
- Example 4: Strings are arrays of characters
somestrings.adb and prettified
- Example 5: Strings are UNCONSTRAINED arrays of characters
mystrings.adb and prettified
- Let's do printnprocs with unconstrained
- Notes on Arrays
- Group project - create an array that is the sum of two parallel arrays:
Finish This!
- Group project - print list of unique words:
- Group Project:
- Input: Sequence of lines of 80 or fewer characters each
- Output: Frequency of each letter
- Output: Frequency of each letter and of blanks and certain punctuation
- Punctuation to count: '.', ',', '!',
- Frequency count should be case insensitive
- Output format: Only output non-zero frequencies
- Ada Pair record and client vs Java Class Pair and client
class Pair{
int dist(){...}
String toString(){...}
Pair reflect(){...}
void reflectMe(){...}
}
|
Procs: chapter 9 |
P3 is here (updated for Fall 09)
|
| Week 7 |
- Exam
- Notes on look_ahead
- More on records
- Review last week's group problem
- Class Project:
- Input: list of words, one word per line, each word is shorter than
80 characters
- Output: Print list of unique words and their frequecies
- Constraint: main is
l: WhatTypeIsThis;
begin
getWords(l);
putWordsAndFreqs(l);
end words;
Constraint: fixed length strings
- Use
get_line(w, len) to input each string
- Example using getline:
declare
w: String(1..80);
len: Natural;
begin
loop
get_line(w, len);
exit when len = 0;
put_line(w(1..len));
end loop;
end;
First step: Design types (draw pictures)
Second step: Read and write all words, ignoring test for uniqueness
|
Arrays: 8.1-6, 2.4; |
P3 is here (Due 11:59 p.m., Tue 10/20/09)
|
| Week 8 |
|
Records: 8.7, 2.4
Packages: 3.1 & Ch. 11 |
P4 is here
|
| Week 9 |
- One other word on C strings (printing ohno as a string):
Notes on Strings
- Packages!
|
Packages: 3.1 & Ch. 11 |
Program 4 |
| Week 10 |
|
Packages: 3.1 & Ch. 11 |
Program 4 due Thurs 11/05/09 |
| Week 11 |
|
Packages: 3.1 & Ch. 11 |
Program 5
|
| Week 12 |
|
LookAhead; Variant Records; Limited Private; Generics: 3.4 & Ch. 17
Pointers: Chapter 10 Section 2.5 |
Exam Mon. NEXT week
Program 5
Program 6
|
| Week 13 |
- Monday:
- Exam THIS WEEK on Monday 4/13/09 on these topics
- Spring Withdraw deadline: 5:00 p.m., TUESDAY of this week (4/14/09)
- Wednesday:
- Friday:
|
|
Program 5
Program 6
(Suggestion: finish Program 5 and start Program 6 ASAP)
|
| Week 14 |
- Monday:
- Wednesday:
- Friday: Group Projects:
-- how many elements
function size(item: Stack) return Natural;
-- output the stack
procedure put(item: Stack);
-- do 2 stacks have identical elements
function equal(l, r: Stack) return Boolean;
-- copy stack s to stack t
procedure copy(t: out Stack; s: in Stack);
Use pointer operations, not stack operations.
equal will require passing in "="(l, r: ItemType) as
a generic parameter)
JEWL is extra credit. Here are some notes on it
|
|
Program 5
Program 6
|
| Week 15 |
|
|
Program 5
Program 6
|
| Week 16 |
Comprehensive Final Exam:
12:30 - 2:30 Monday 5/4/2009
|
|
Comprehensive Final Exam |
| Notes for entire semester |