CS 106A Lecture Notes - Lecture 9: Substring

33 views2 pages

Document Summary

Procedural design: general rules for designing good methods: Each method should have a clear purpose. Header with too many and s = bad method. No one method should do too large a share of the overall task. The run method should be a concise summary of the overall program. It is bad if each method calls the next without ever returning ( chaining ) Data should be declared/ used at the lowest level possible. Review of return: return returns the value of a certain calculation without actually printing it for the user to see. Strings: string: an object storing a sequence of text characters. Notice uppercase of s in the command string. Then use println(name); to print the string. You can store a message or an expression in a string. Indexes: characters of a string are numbered with 0-based indexes. Last character"s index: 1 less than the string"s length.

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