# Syllabus Notes

## Syllabus

### Me and You

• Me: Dr. Okie, nokie, 219 Davis, office hours
• You: Prereq: 220 C or better
• Survey

### ITEC 320

• Procedural Programming:
• No Classes
• No Objects
• No References

### Language of Choice: Ada - History

• U. S. Department of Defense:
• 400 languages
• Specifications for single language
• World wide competition
• Versions: 1983, 1995, 2005, 2012

### Language of Choice: Ada - Design Goals and Characteristics

• Design Goals:
1. Reliablitity
2. Efficiency
3. Concern for programmer

• Characteristics:
• Expressive
• Rich type system
• Low life-cycle cost

### Examples: Expressive, Rich Type System

• We see many examples of Goals and Characteristics
• ```   ...
type My_Array is array (-10 .. 10) of Integer;

subtype Even is Integer
with Dynamic_Predicate => Even mod 2 = 0;

function all_even(a: My_Array) return Boolean is
(for all i in a'range => a(i) in Even);

small: Integer range 1 .. 10;
e: Even;
n: Natural;
some_array: My_Array;
...
small := small + 11; -- Catch error on assignment, not use
e := e + 1;          -- Catch error on assignment, not use

if all_even(some_array) then
...
```

### Examples: Reliability

• Pre and post conditions can be used to prove program properties
```   ...
function match (needle, hay: String; loc: Positive) return Boolean is
(for all i in 1 .. needle'length => needle(i) = hay(loc + i - 1))
with
pre => loc in hay'length - needle'length - 1,

function search (needle, hay: String) return Natural with
pre => needle'length in 1 .. hay'length,
post => (search'result in 0 .. hay'length - needle'length + 1
and then
(if search'result > 0 then
match(needle, hay, search'result)
else
(for all loc in 1 .. hay'length - needle'length + 1
=> not match(needle, hay, loc))
))
```
• The SPARK system can prove:
• AoRTE (Absense of Runtime Errors) in the implementation
• That the implementation causes the postcondition to be true if the precondition is true
• Callers of search will guarantee its preconditions and can assume its postcondition

### Text

• Barnes (2005 or 2012) - mostly for reference
• Others:
• Ben-Ari
• WikiBook

### Evaluation

• 10 point scale
• Programs - normally 5 - about 50%
• DON'T do the programs from last year! (Unless you feel like it!)
• Two exams and comprehensive final - 50%
• Homework and in-class activities

• Partial credit
• Style

### Program Submission

• Unix command ` submit `
• Must run on rucs using terminal program
• Windows: putty
• Mac or Linux: terminal
• Check submission
• Be smart: keep a copy on rucs

### Policies

• 10% per day late penalty for programs
• Attendance - not required, but ...
• Exams: grade of 0 if miss without permission
• Distractions: No phones, laptops, food etc

• Work you submit for grading must be your own!
• You may discuss how language features work
• You may discuss what task an assignment is to accomplish
• You may NOT discuss how to accomplish an assignment's task
• Cite any help (eg from friends, book, web) in program comments

### Accommodations

• See me if you need them

### Success

• High WDF rate - don't let yourself be a statistic!
• Come to class - every class
• Come to class - prepared to learn
• Start programs early!
• Start programs early!
• Start programs early! - Give yourself time to climb the learning curve!
• Get help, from me, from tutors
• Never give in, never, never, never! [citation?]