09-17 Class Notes CS 107

09-17 Class Notes CS 107 - 09-17 Class Notes CS 107...

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

View Full Document Right Arrow Icon
Announcements: Program #3 has been posted online. While I will add some to the description and hints, it will not substantially change. Questions? Last Time: Methods: transfer of control, sending values in, the return value Why we want to use methods - Attempting to change the values of parameters - Scope - Methods should have their own name (identifier that we choose), return type(e.g. int, char, or void if it does not return a value, and a parameter list inside parenthesis. Today: More on methods: Have a method that doesn't change any variables, but perhaps only displays them. E.g. a method to displayBoard() Do this using a single return value Do this using an instance variable Have a method change the value of a variable that is also used in the calling section of code: Have a method change the value of multiple variables that are also used in the calling code. E.g. the "swap" program
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
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 COP 2271 taught by Professor Reed during the Fall '10 term at University of Central Florida.

Page1 / 4

09-17 Class Notes CS 107 - 09-17 Class Notes CS 107...

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

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