RU beehive logo ITEC dept promo banner
ITEC 380
2012fall
ibarland
tlewis32

homelecturesexamshwsbreeze (snow day)

hw02
book background; structs
due Sep.12 (Wed)

Due Sep.12 (Wed) (hardcopy, and on D2L) Your name and the assignment-number must be in a comment at the start of the file.

  1. (9pts) Chapter 1, Review Questions1
    1. #6
    2. #9
    3. #10
    4. #11                  can used to implement control-flow.
    5. #14 type checking parameters is important because                 
    6. #15 Aliasing is                 
  2. (2pts) Which languages might be involved in setting up an on-line order system, for a store?
    (Feel free to chat with people who have taken Software Engineering.)

  3. (6 pts) Chapter 1 gives six costs associated with a programming language. Which single cost do you think is most important for…
    1. code controlling the space shuttle launch
    2. code for a payroll program to be used by a Coca-Cola International.
    3. code for a scientific simulation of proteins in a cell, to help develop new drugs.
    4. code to compute what percentage of RU students have more than one picture on their RU home web page. (Suppose that a friend is writing a report for a Media Studies project, and wants to include this statistic.)
    5. Code for maintaining all aspects of a course gradebook (entering and editing information, adding new features on demand like “replace-lowest-hw-with-exam-percentage”, generating web-views for instructor and students, adding new features to the web-views as requested, etc.).
    (Just give the name of the category, e.g. “compiling programs”.)

    Which of the five example programs above is most “typical” do you think, of the sort of programs most programmers tend to work on?

  4. Short answer: define each term in a few words, and give an example of a language:
    1. Type-safe
    2. Statically typed
    3. Dynamically typed
  5. Two definitions:
    soundness
    If a type system is sound, then if the type system allows a program to run, then the program does not contain any type errors.
    (This is the same as2 type-safe.)
    complete
    if a type system is complete, and a program has no type errors, then the type system will let it run.
    The Java type checker is sound, but not complete. Give a sample Java program which (if the type-checker let it compile) would never give a type error, yet it does not actually compile.
    hint: Your program need not be useful at all, so long as it illustrates this point.
    Write a program which has an illegal `return` statement that is never ever reachable.

1 Short correct answers get more credit than long correct answers; use a single word when possible.      

2 Why are "type-safe" and "sound typesystem" two ways of saying the same thing? Soundness/completeness are general traits of any theorem-proving system.      

homelecturesexamshwsbreeze (snow day)


©2012, Ian Barland, Radford University
Last modified 2012.Sep.10 (Mon)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Powered by PLT Scheme