CMPSC 56 Chapter Notes - Chapter 5-6: Instance Variable, Texas State Highway Loop 1, Dynamic Array

45 views2 pages
30 Sep 2017
School
Course
Professor

Document Summary

Remember: focus on the things in the program rather than the procedures. Figure out what the class is supposed to do. Prep code = a form of code to help you focus on the logic. Includes instance variable declarations, method declarations, and method logic. Test code = a class/methods that will test the real code and check if it"s doing the right thing. Real code = the actual implementation of the class. Write test code first to make it easier/faster to write the actual code. Should write a little test code, then write only the implementation code needed to pass the test, and so on. To convert a string to an int: integer. parseint(3) Enhanced for loop: for (int i : arr) {} int is just the data type that the array holds break statement immediately gets you out of a loop. To get a random integer from 0 < randomnum < n: int randomnum = (int)(math. random()

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