PreparationTest2_Sp06

PreparationTest2_Sp06 - CIS 120 Problem Solving and...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 120 Problem Solving and Programming Review for Test 2 Control structures Repetition o for loops What is the for-loop? What does it do? What type of looping does it excel at? What is the format of a for-loop? o do-while loops What is the do-while loop? What does it do? What are some good uses for it? What is the format of a do-while loop? o What is a pre-test loop? Which loops are pre-test loops? o What is a post-test loop? Which loop is a post-test loop? o What is nested repetition? How is it used? Selection o What is a switch statement? What does it do? o What limitations are associated with switch statements? o What is the format of a switch statement? o Why should you put a break at the end of each case? o How do you signify that the same section of code should be executed for several cases? (i.e., if you need to do a particular task if your value is one of a small group of values, how do you specify that with a switch statement?) Methods Why do we use methods? Why are they useful? What is the divide-and-conquer approach to problem solving? What is software reusability? Why is it useful? Why do we want to avoid retyping the same code over and over again? Method Headers o What are the basic components of a method header? o What does the keyword public mean in the method header? o What does the keyword static mean in the method header? o What types of values can a method return? o What does the keyword return do? o What do we put as the return type if the method does not return any values? o What does the keyword void mean? 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
o What is a parameter list? o In the message header, what must you specify for each parameter in the parameter list? o What does it mean when the return type of a method is void? o What is a method’s signature? [The signature is the method name and parameter types required – this signature is used by programming languages to determine the exact method to be executed.] What goes in a method body? What does it mean to call or invoke a method? Miscellaneous Random number generation o Why are random numbers useful? o What Math method do we use to get a random numbers? o How would you get a random integer value between 1 and 10? o How would you get a random value in the range from 0 to 2? Casting o What is casting? o What data types can casting be used with? Strings o How do you determine the number of characters are in a String? o What are the length and charAt methods used for? o How are the length and charAt methods used (i.e., how are they called and what parameters do they require)? o What is the numeric index of the first character position in any String? Programming: Know how to use…
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/10/2012 for the course CIS 120 taught by Professor Doran,m during the Spring '08 term at S. Alabama.

Page1 / 20

PreparationTest2_Sp06 - CIS 120 Problem Solving and...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online