Computer Science 433
Programming Languages
Fall 2014, The College of Saint Rose
Lecture 19: Data Type Wrapup Wrapup (Really); Expressions and Assignments
Date: Wednesday, November 5, 2014
Agenda
- Announcements
- Program/Problem Set 8: Datatypes, Expressions and
Assignments [HTML] [PDF] continues
- Last words on data types
- Expressions and assignments
Lecture 19 Assignment
Due at the start of class, Monday, November 10.
Please submit answers to these questions
in Submission
Box under "LA19" or in hard copy by the
start of our next class. We will discuss these questions at the
start of class, so no late submissions are accepted. Please be sure
that your name is clearly indicated in all submissions.
- Write a short program in C, C++, or Java that clearly
demonstrates the side effects of the
++
. Be sure to check on
both preincrement and postincrement modes. Explain in detail in the
comments in your program what happens with each ++
and why.
(6 points)
- Briefly discuss the relative advantages of Pascal's choice of
assignment operator (
:=
) and equality operator (=
) and
that in the C-based languages (=
and ==
,
respectively). (4 points)
Terminology
- reference type
- garbage collection
- reference counters
- mark-sweep approach
- type checking
- compatible types
- type error
- strongly typed
- name and structure type equivalence
- expression
- operands
- operator
- arithmetic expression
- side effects
- referential transparency
- overloaded operator
- type conversions/coercions
- narrowing vs. widening conversions
- mixed-mode expressions
- cast
- relational operators
- logical operators
- short-circuit evaluation
Examples
Links