CSC 216 F09/: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
===Formatting Resources===
==Background==
[http://meta.wikimedia.org/wiki/Help:Wikitext_examples Formatting Help Guide from MetaWiki]
This is a simple exercise for finding recursive equations and writing them as Java code.


==Place Title of Exercise Here==


Give the title of your exercise, which may include the name of the topic you are covering, or some other catchy title.
===Props===
1. Whiteboard


===The problem===
2. Access to a Java editor


Describe what you are attempting to teach students by this exercise.
===Procedure===


===Participants and props===
1) Give each row a sequence of numbers.


How many students will participate?  What else do you need (e.g., old tennis ball, Powerpoint slides, software).
Ex:


===The script===
a) 2, 6, 10, 14,...


Describe how to do your exercise.
b) 0, 1, 0, 1...
 
c) 2, 6, 12, 20...
 
d) 1, 4, 9, 16...
 
 
2) Then have each row work together to find the recursive definition for the sequences.
 
Ex:
 
a) 4n-2
 
b) 1+(-1)^n
 
c) n(n + 1)
 
d) n^2
 
 
3) Lastly, each group should write Java code to implement the recursive equation and submit via Google Docs.
 
Ex:
 
a)
 
public int recursion( int n ){
    int a = 0;
    if(n == 1) a = 2;
    else a = recursion( n - 1 ) + 4;
    return a;
}
 
By: David Duran & Dereck Allred

Latest revision as of 02:51, 18 November 2009

Background

This is a simple exercise for finding recursive equations and writing them as Java code.


Props

1. Whiteboard

2. Access to a Java editor

Procedure

1) Give each row a sequence of numbers.

Ex:

a) 2, 6, 10, 14,...

b) 0, 1, 0, 1...

c) 2, 6, 12, 20...

d) 1, 4, 9, 16...


2) Then have each row work together to find the recursive definition for the sequences.

Ex:

a) 4n-2

b) 1+(-1)^n

c) n(n + 1)

d) n^2


3) Lastly, each group should write Java code to implement the recursive equation and submit via Google Docs.

Ex:

a)

public int recursion( int n ){

   int a = 0;
   if(n == 1) a = 2;
   else a = recursion( n - 1 ) + 4;
   return a;

}

By: David Duran & Dereck Allred