Using Contests to - A+ Computer Science

Download Report

Transcript Using Contests to - A+ Computer Science

www.apluscompsci.com
Computer Science Teacher / CS Coach
Carroll Senior High – 7 years
Cypress Falls – 4 years
Cypress Woods – 1 year
www.apluscompsci.com
Computer Science Coach
UIL 4A State Champs 2001
UIL 4A State Champs 2002
TCEA State Champs 2002
UIL 5A State Champs 2003
TCEA State Champs 2003
TCEA State Champs 2005
UIL 5A State Champs 2006
TCEA State Champs 2006
www.apluscompsci.com
How can contests increase enrollment?
get students excited
create a sense of pride
provide scholarship opportunities
create a sense of purpose
www.apluscompsci.com
Contests are fun and students
enjoy getting a chance to test
what they know outside the
classroom. After attending just
one contest, most students are
hooked.
www.apluscompsci.com
Once the students begin to
have success with contests, a
sense of pride is created and a
tradition begins. Each student
wants to work a little harder to
get in on the winning action.
www.apluscompsci.com
If students succeed in the
contest arena, there are
scholarships available through
some contests and through
certain universities. The more
success a student has the
better the scholarship.
TILF
www.apluscompsci.com
As the contest fever sweeps
through your program, each
student that competes feels a
much larger sense of purpose.
Comp Sci becomes a crusade
and new students start signing
up.
www.apluscompsci.com
Teach basic contest strategy
write code on paper
never debug on the PC
print often
rotate PC time
www.apluscompsci.com
Write a complete program on
paper that anyone on your team
could type in. Write neatly and
be thorough. Solve problems on
paper, not on the PC!
www.apluscompsci.com
NEVER – NEVER – NEVER
Never debug on the computer
during a contest!
PRINT – PRINT - PRINT!!!!
4th person
www.apluscompsci.com
Good teams print every few
minutes or so.
Bad teams never print!
www.apluscompsci.com
Teams must share PC time. One
student works on the PC for a
short time to enter a program. If the
program works, submit it. If not,
print it and get out of the way.
Repeat this process.
Fitzgerald
www.apluscompsci.com
Advanced students teach beginners
have veterans peer tutor
solve lots of problems
learn common algos
practice, practice, practice
www.apluscompsci.com
Have your top students work
with and tutor the beginners.
This peer tutoring process
means a lot to the experienced
kids and the new kids.
www.apluscompsci.com
Have the advanced students
show the beginners how to
solve the difficult problems and
the basic problems.
www.apluscompsci.com
Have the students and teams
work problem after problem
after problem. There is no
substitute for solving problems.
Solve the same problem 50
times if needed.
www.apluscompsci.com
Master the common algos that
show up at every contest.
Know how to solve a maze and
write a permutation. Know
how to write a sort algo and a
spiral matrix.
www.apluscompsci.com
Because recursion has became
such an important part of
contests, I spend extra time on
that topic in my CS classes. I
also teach several extended
units on Sets, Maps, and the
Comparable interface.
www.apluscompsci.com
Organize after school practice
contests and work pack after
pack after pack. You have to
solve lots of problems to
become the best.
www.apluscompsci.com
Learn basic programming operations
how to make a template
reading from files with a for loop
reading from files with a while loop
chopping up Strings with Scanner
chopping up Strings with split
regular expressions
www.apluscompsci.com
//imports
public class template
{
public void run() throws Exception
{
Scanner file=new Scanner(new File("prxx.dat"));
//code goes here
}
}
public static void main(String[] args) throws Exception
{
template a=new template();
a.run();
OOP at
}
contests
www.apluscompsci.com
Scanner file;
file = new Scanner(new File("pr21.dat"));
pr21.dat
567
345
www.apluscompsci.com
nums.dat
6
23
11
6634
123
532
123
# of data sets (6)
www.apluscompsci.com
Scanner file;
file = new Scanner(new File("nums.dat"));
int cnt = file.nextInt();
for( int i=0; i<cnt; i++ )
{
int num = file.nextInt();
out.println( num );
}
www.apluscompsci.com
34
23
11
6634
123
532
123
531
www.apluscompsci.com
Scanner file;
file = new Scanner(new File("nums.dat"));
while( file.hasNext() )
{
int num = file.nextInt();
out.println( num );
}
www.apluscompsci.com
3
I went to the store.
The big dog ran.
How are you doing?
www.apluscompsci.com
Scanner file;
file = new Scanner(new File("pr21.dat")));
int cnt = file.nextInt();
file.nextLine();
//clears the buffer
for( int i=0; i<cnt; i++ )
{
String line = file.nextLine();
//code
}
www.apluscompsci.com
I went to the store.
The big dog ran.
How are you doing?
www.apluscompsci.com
Scanner file;
file = new Scanner(new File("pr21.dat")));
while( file.hasNext() )
{
String line = file.nextLine();
if( line.length() > 0 )
//code goes here
}
www.apluscompsci.com
String s = "abc def hij klm";
Scanner chopper = new Scanner(s);
while( chopper.hasNext() )
{
out.println( chopper.next() );
}
www.apluscompsci.com
String s = "abc def hij klm";
String[ ] list = s.split(" ");
for( String word : list )
{
out.println( word );
}
www.apluscompsci.com
String s = "123 435 444";
Scanner chopper = new Scanner(s);
while( chopper.hasNextInt() )
{
out.println( chopper.nextInt() );
}
www.apluscompsci.com
String s = "12abcd45abcd";
s=s.replaceAll("ab", "-");
out.println(s);
OUTPUT
12-cd45-cd
www.apluscompsci.com
String s = "12abcd45abcd";
s=s.replaceAll("[abc]", "-");
out.println(s);
OUTPUT
12---d45---d
www.apluscompsci.com
String s = "12abcd45abcd";
s=s.replaceAll("[^abc]", "-");
out.println(s);
OUTPUT
--abc---abc-
www.apluscompsci.com
How can contests increase enrollment?
students want to win
students want to go to college
students want to belong
www.apluscompsci.com
Most students want to win
something. Once they hear
about CS contests and realize
they have a chance to win, they
start signing up.
www.apluscompsci.com
Most students want to go to
college and colleges like
students that are involved in
extracurricular activities.
Adding a few CS contests to a
college application cannot hurt.
www.apluscompsci.com
Most students are looking for a
place to fit in. For many
students, the CS team is a
great place to find friends and
a competitive outlet.
www.apluscompsci.com
tcea website
uil website
javabat website
apluscompsci
www.apluscompsci.com
Make the class fun
graphical projects
interactive projects
game progams
PONG – PAC MAN - BLACKJACK
www.apluscompsci.com
www.apluscompsci.com
stacey.armstrong@
apluscompsci.com
www.apluscompsci.com