CSE8A: Introduction to Programming in Java

Download Report

Transcript CSE8A: Introduction to Programming in Java

Creative Commons Attribution
Non-Commercial Share Alike License
• http://creativecommons.org/licenses/by-ncsa/3.0/
• Original Developer: Beth Simon, 2009
[email protected]
Instructor Meta Slides
• Have a gray background like this
• They provide some suggestions on
– helping students approach clicker questions
properly
– On how to “use” a slide that reinforces with
students the value of peer instruction
• We expect you will delete these before use
in class.
CSE8A
Find your discussion group
INTRODUCE YOURSELF
(if you don’t know your number,
give your last name to a TA)
CSE8A Lecture2
• TURN IN INTEGRITY FORMS NOW! (pass to aisle)
– If you just added the course, check our class web page for things
that are due, don’t worry you can complete them late!
– http://moodle.ucsd.edu
• TODO:
– Pre-Survey, Syllabus Quiz, Chapter 2 Quiz, Reading Quiz (1 before each
lecture)
– Make a UP login to preview/review lectures
– LOOK UP YOUR cs8f ieng6.ucsd.edu account on ACS (for lab on wed)
– Goto lab Wed before class
– Contact your pair programming partner via email (more in a few slides)
• Read next class: pages 50-59, take the online reading quiz.
CLICKERS OUT!
LAPTOPS? http://up.ucsd.edu
Lectures:
• Did you know…
– Professors and students literally cannot
experience “lecture” the same way?*
• So I’m not going to stand up here are say
things that I think are clear
– When I can’t tell how you are hearing and
understanding them.
Uh, so what will we do in lecture?
*Hrepic, Zollman and Rebello. Comparing Students’ and Experts’ Understanding
of the Content of a Lecture, Journal Science Education and Technology 2007.
Lectures:
Clickers and Peer Instruction
• I’ll bring in activities to ENGAGE you in exploring
your understanding of the material
– Let you practice
– Bring out misconceptions
– Let us LEARN from each other about difficult parts.
• You will be GET CREDIT for your efforts to learn in
class
– By answering questions with a clicker (iClicker)
– Answer 80% of the clicker questions in class, get 2% of your
final grade
• Process:
– Individual Answer, Group Discussion, Group Answer
Lectures: Ubiquitous Presenter
• A Tablet PC based system that allows me to
– Write and draw spontaneously on slides
– Have ink stored on the web
• Allows you to
– Review class lecture slides on line
– Tag and Search lecture slides
– Search Web and ADD THINGS to lecture slides
– Contribute to class, if you bring a wireless
laptop
• More next class – bring them if you have them
– Bring your UCSD network login and password
Class Logistics:
Paper hand out not complete!
• Web Site: Visit it at LEAST twice a week!
– http://moodle.ucsd.edu
– We’ll update it likely DAILY
– USE DISCUSSION FORUMS
• Discussion Sections: Go!
– Short ones today
• Office Hours: Monday 1-2pm and Thurs 12-1pm
AND BY APPOINTMENT
• Closed Lab: (CSE8AL) – go to your assigned one on Wed OR go
at 9am if you indicated you wanted to switch
• APE labs: Basement of CSE building – B260
– Undergrad tutors there to help you
– NOT to do your work, but to help you if you come to them with
a question you have worked on and are prepared to explain
BEFORE LAB!!!
• ACS Lookup Tool is your friend!
– Account login information
• NEW ACCOUNT (not your UCSD email address one)
• Your CSE8A one (e.g cs8waa, cs8wab, etc.)
– Door codes for B260
– Lots of helpful info!
• Tutors will begin lab hours Wednesday
– Hours will continue to be added
• Closed labs occur Wednesday
– You must be enrolled for one section
– Get there EARLY (give yourself time to find it)
Pair Programming
• People who pair in a first programming course, do BETTER in a
second programming course.
– Everyone must pair. If you have truly extenuating circumstances, see
me in office hours or email me.
• Who will I pair with?
– Contact your partner (See the list on moodle)
• If you aren’t on the list or your partner is no longer in class, Post on “PP Partner
Finding Forum”
– Meet with them and block of 6 hours a week you are available to work together
in the lab. Write those hours on a piece of paper with both your names and
turn it in Wed or Friday.
• What is pair programming?
– See the class web page: Practice in lab on Wed.
• CSE8AL Note:
– your pair partner in lab is DIFFERENT (and changes each week)
Learning Goals:
By the end of CSE8A you will be able to…
1.
Design computational solutions to problems. This requires applying the following
skills to problem statements or code: explain, compare and contrast, argue,
diagram a memory model, and design a class.
2.
Code a Java implementation to problems. This requires applying skills including
code writing, code modification (including of others‘ code), and explaining what
code does.
3.
Analyze and debug Java programs. This requires applying skills including
reading and understanding code, tracing variable values, and debugging.
4.
Communicate professionally about Java programs. This requires applying skills
such as explaining code you wrote, arguing about coding and design decisions, and
drawing memory models to explain behavior.
5.
Solve basic problems by applying goals 1-4 as steps in a process to create a
Java program.
6.
Apply goals 1-5 in various media-related contexts to make interesting
applications involving digital images (filters, collages, special effects) and digital
audio files (mixing music).
Getting Access
• ACS Lookup Tool is your friend!
– Account login information
• Look up your CSE8 account:
–
Your CSE8A one (e.g cs8waa, cs8wab, etc.)
– Door codes for B260
– Lots of helpful info!
• Tutors have begun lab hours – there will be some this weekend
– Hours will continue to be added – check web site
• Closed labs occur Wednesday
– You must be enrolled for one section
– WE NEED 8-10 volunteers to move from 10 or 11 am to 2pm…
• Keith plays the Ukulele!
CLICKERS OUT!
LAPTOPS? http://up.ucsd.edu
CSE8A: Introduction to
Programming in Java
Chapters 2 and 3 (up to 50)
Chapter 2 Quiz
• Very well done!
• We had an error in our quiz – anyone find it?
• Most common confusion
– String name = “Bob”;
– name Has the address in memory where “Bob”
is stored.
By the end of today’s class you should
be able to…
• LG1: Implement the “peer instruction” process by
– A) clicking in on an answer
– B) discussing with your team
• Who are they? Two people sitting next to you
– C) coming to consensus and re-clicking in
• LG2: Describe the difference between the Dr. Java interaction
pane and definition pane (using IM and email as a metaphor).
• LG3: Describe how = is different in programming than it is in math.
• LG4: Be able to track a turtle’s path by reading and tracing code
• LG5: Identify common errors in Java code and use computing
terminology to describe them
• LG6: Read and modify a method to perform a given task with a
Turtle. Specifically understand the use of a parameter to a
method.
1) SOLO VOTE
(30 secs)
2) Discuss in team
(1 min)
3) GROUP VOTE
(20 sec)
Dr. Java IDE
• Which pane holds the
permanent copy of a
Java code (like an
email)
and which holds a
temporary copy that
can’t be saved (like
an IM session)?
Can you do LG2 now?
1) SOLO VOTE
(30 secs)
2) Discuss in team
(1 min)
3) GROUP VOTE
(20 sec)
What does equals do?
• What is the output of this code?
int x = 3;
int y = 2;
System.out.println(x == 3);
int z = x + y;
System.out.println(z);
A) 3
5
B) true
5
E) None of
the above.
C) 3
false
D) true
false
Can you do LG3 now?
Instructor Meta Slide
• Next slide
– Use this example to focus students on the fact
that these questions aren’t JUST for getting
right – they are for taking the time to LEARN as
much as they can and make sure they fully
understand the topic under discussion.
– Encourage them to be able to explain why the
wrong answers are wrong.
1) SOLO VOTE
(30 secs)
2) Discuss in team
(1 min)
3) GROUP VOTE
(20 sec)
Terminology: See Jane Run
Turtle turtle1 = new Turtle();
turtle1.turn(-45);
Does your team know
what these terms mean/are?
A. Type, method/message name, parameter list
B. Class, method/message name, parameter list
C. Object, method/message name, parameter list
1) SOLO VOTE
(1 min)
2) Discuss in team
(2 min)
3) GROUP VOTE
(30 sec)
A
B
What does this code output?
World world1 = new World(200,100)
Turtle maria = new Turtle(25,25,world1);
Turtle jose = new Turtle(100, 50, world1);
maria.forward(25);
jose.forward(10);
maria.turnLeft();
Hint: Turtles start facing “up”
maria.forward(50);
jose.forward(5);
C
D
Aside: Showing “partial code” in class
• Sometimes I won’t show complete code on a
slide in class (because of lack of space).
• You can assume… (or ask me)
World world1 = new World(200,100) //World declared
Turtle maria = new Turtle(25,25,world1);
//Turtle/object declared, initialized
//AND that it hasn’t been asked to move yet