CSE 1223 Study Guide - Midterm Guide: Infinite Loop, Substring

573 views2 pages

Document Summary

2 programming questions (write code: do not need to comment on programming questions, indent, capital letters where needed, semicolons included, while loops, array problem. Short answer (like homework: ~ 12 questions. Int length(: string str = hi , system. out. println(str. length(), returns number of characters in string. Char charat (int x: system. out. println(str. charat(0), start at 0, returns the character at position x in string. String substring (int start, int end(end-1: returns the string starting at position start through position end (end-1, system. out. println(str. substring(0,4)); Int indexof(string astring: returns position of first occurrence of given string, string str = this is a string , system. out. println(str. indexof( this )), output = 0. Boolean equals (string astring: string str = test , system. out. println(str. equals( test , output = true. Review if/else statement sections: if( ) { Use == for integers, and = for strings. String methods will be give: need to know how to use them, && (and, || (or) (not)

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

Related Documents