Com S 100J Introduction to Computer Programming Grade: letter or S/U Spring 2005
655-085 TR 09:05 Kimball B11 Instructor: David Gries 4 credits
655-276 TR 11:15 Olin 255 Newsgroup: cornell.class.cs100j

Quiz 01. Thursday, 3 February. Types, expressions, variables, and assignments
Home
About email
Academic Excellence Workshop
Academic integrity
Announcements
DrJava
Exams & grades
FAQs
Handouts, general
    Assignments
    Labs
    Quizzes
Links
Staff info
Syllabus
Texts
Times & places
 
Email Gries

 

Every week or so, we will have a quiz in lecture. We will tell you what will be on the quiz. We expect everyone to get 100 on every quiz. This quiz covers more definitions than any other one in this course. At the beginning, there is a lot of new terminology.

Reason for quizzes.

A course like CS100 uses a lot of terminology and introduces many new concepts. Typically, the terminology and concepts are used from the day they are introduced onward. If you don't learn them soon after they are introduced, you can't understand later lectures and material. So, each quiz alerts you to what is important for you to learn at that time (and forces you, hopefully, to learn it). We hope that you don't only superficially learn it but grok it. (If you don't know what grok means, bring up ProgramLive (the CD), open the glossary, and look at the entry for grok.

For quiz 01, you have to be able to write down the definitions of the following terms. We give the definitions here. You don't have to use exactly the same wording, but the precise meaning must be there.

1. Type. A set of values together with operations on them.

2. Type int. the integers 2**31 .. 2**31-1 together with the operations +, -, *, /, and %.

3. Type double. "Floating point" numbers, like 5.3*10**-30, together with the operations +, -, *, /, and %.

4. Type boolean. The values true and false together with the operations ! (not), && (and), and || (or).

5. Cast. To change a value from one type to another. You have to know how to cast in Java. Example, to cast the integer 3 to a double value, use the expression (double) 3.

6. Variable. A name together with an associated value. We draw a variable as a named box, with the value going in the box.

7. Identifier. In Java, a sequence of letters, digits, and _, with the first not a digit. Identifiers are used as names of variables (among other things).

8. Assignment statement. Syntax: <variable>= <expression> ; , where the type of the <variable> is the same as or wider than the type of the <expression>.
Semantics: To execute an assignment statement, evaluate the <expression> and store its value in the <variable>.

9. Syntax. The rules that define the structure of sentences (in our case, of expressions, statements, and programs).

10. Semantics. Meaning. For a Java expression or statement: how it is evaluated or executed.

11. Grok. Look it up in the ProgramLive CD glossary (This is here to get you to become familiar with the CD).