CourseNotes
Published on CourseNotes (https://course-notes.org)

Home > AP CSA Chapter 6 Flashcards

AP CSA Chapter 6 Flashcards

Terms : Hide Images [1]
8688327386while statement-loop structure that executes a set of statements over and over based on a condition while (condition) { }0
8688327387do-while statement-executes at least once do { } while (condition);1
8688327388infinite loops-if conditions never becomes false CAUSES: - syntax error -forgetting ending curly brace -logic error2
8688327389overflowoccurs when there are not enough bits to store a number3
8688327390counter-incremented by a constant value useful for keeping track of number of times user makes a guess or types a password4
8688327391accumulatornew value is added to the last value initialized and decalred5
8688327392Sentinel, flagconstant that stores a value to signify that the loop should stop iterating6
8688327393for statementexecutes set of statements a fixed number of times - for (; ; ) { }7
8688327394loop control variablea counter to control the iterations8
8688327396increment operator(i++) - increases value of a variable by 1.9
8688327398break (or breakpoints)points in code were execution will be suspended10
8688327403string.length()returns integer corresponding to number of characters in a string11
8688327404string.substring(int, int);returns substring of string, starts at sarting position and ends one character before end position12
8688327405string.substring(int start);returns substring which starts at start position and extends to rest of string13
8688327406string.toLowerCase();returns copy of string with all lower case14
8688327407string.toUpperCase();copy of string in all caps15
8688327408string.trim();removes all leading and trailing spaces16
8688327411indexposition of character in string (starts at zero)17
8688327414string.equals(String str);returns TRUE when string is the same as str. returns FALSE otherwise18
8688327415string.equalsIgnoreCase();same as equals() except differences in upper and lower cases are ignore19
8688327416string.compareTo(String str);-returns 0 when str is the same as the string. - negative number returned when str comes after the string alphabetically. - returns positive number when str comes before the string alphabetically.20
8688327417string.compareToIgnoreCase();same as compareTo() except lower and upper case differences are ignored21
8688327418string.indexOf(String str):returns integer corresponding to the location of the first occurence of str in the string. Otherwise -1 is returned22
8688327419string.lastIndexOf(String str);returns integer corresponding to last occurence of str in the string. otherwise -1 is returned23
8688327420string.startsWith(String str);returns TRUE when string begins with str. returns false otherwise24
8688327421string.endsWith(String.str);returns true when string ends with str. returns false otherwise.25
8688394473switcha statement that matches a character or integer value to one of several possible cases.26
Powered by Quizlet.com [2]

Source URL:https://course-notes.org/flashcards/ap_csa_chapter_6_flashcards

Links
[1] https://course-notes.org/javascript%3Avoid%280%29%3B [2] http://quizlet.com/