COMP 202 Lecture Notes - Lecture 3: Real Number, State Diagram, Floating Points

55 views5 pages
jc123 and 40170 others unlocked
COMP 202 Full Course Notes
100
COMP 202 Full Course Notes
Verified Note
100 documents

Document Summary

If you write an equation with an integer, java will return an integer. If you put a decimal, jave will not round to the nearest integer. ] Comp 202 lecture 3 variables, primitive data types, operators. [note on the last lecture: Why do we use variables: code readability, code generalisation, temporary storage for manipulation. [variables must be assigned before they can be used: declaration, initialistation, manipulation. Conventions for names (lowercamelcase): don"t start with $ Start with the lower case but then capitalise the first letter of each word inside the name of the variable. Short but not too short: name it something descriptive of its purpose and content, unique. Good eg. catname, tempf, hour, classcode. Bad eg. asfdstow, dateoftoday, urstupid, capitalsanywhere. Remember: java is case sensitive. You can declare multiple variales of the same type on one line. Variable declarations are statements they appear inside the method.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents