IAT 167 Lecture Notes - Lecture 5: Concatenation, Edge Detection, Escape Character

65 views4 pages

Document Summary

If an object hits any edge of the display window. Resolve by making it bounce off or wrap around the screen: a point hits an object. Detect if a point falls within an object. Circle: if ( dis ( x , y , xpos , ypos ) < owidth /2) [distance between (x,y) and (xpos, ypos) shorter than width/2] Detect if the pixels of a object overlap another. Indexoutofboundsexception [error when size becomes less than constant when object is removed] [?] Concatenation: appending one string at the end of another ("+") String sentence = s1 + "best" + s2; Nf(float, digits before decimal, digits after decimal) Sentence = s1 + nf(7,3) + " "+ s2; Sentence = s1 + nf(3. 14159, 1, 2) + " "+ s2; \ : escape character (tells computer to look at the next character) E. g. println ("i am on one line. \ n i am \ t on another.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions