Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
UCSD CSE 15L
Java Debugging and
the Scientific Method
Week 1
September 28, 2011
Why does this course exist?
1. To improve your skills programming in Java.
2. To get practice working with code written by other people.
3. As a lead-in to courses on software engineering.
4. As an introduction to what it is like being an engineer: 
teamwork, fables.
5. To teach the scientific method.
6. To replace a physics lab course.
What will you do in 15L?
Main answer: Locate and fix mistakes in Java programs.
Other answers:
• Do technical writing.
• Work in a team of two.
• Learn and apply the scientific method.
• Absorb guidelines about debugging in general.
Debugging by David J. Agans
“... simple, foolproof principles guaranteed to
 help find any bug quickly.  This book makes 
those shelves of application-specific debugging
books (on C++, Perl, Java, etc.) obsolete.  It 
changes the way readers think about debugging, 
making those pesky problems suddenly much 
easier to find and fix.”

Course staff
Instructor: Charles Elkan (Professor)
Four teaching assistants:  
Rohan Anil, Tatenda Chipeperekwa, Sanjukta Mitra, Rakesh Varna
Six tutors:  
Chelsea Baltierra, Roshni Chandrashekhar, Prabu Dhakshinamurthy, 
Sidarth Vijay, Chen Xie, Stephanie Yeh
Breakdown of grades
10% quizzes; lowest one score removed
30% final exam
60% labs (3/8 notes, 5/8 reports); lowest notes score and 
lowest report score removed
Total 40% individual, 60% joint.
Some notes
1. Quizzes will last seven minutes.  
2. Quizzes will be similar to the final exam.
Important:  It is likely that scores will be more spread out on 
the final exam than on the labs.
The first quiz is next week at 3pm, October 5.  Be on time.
Lectures and labs
• Every Wednesday, please be on time at 3pm here, WLH 2005.
• After the quiz and lecture, walk to the CSE building basement.
• Use the lab rooms B230, B240, B250 and B260.  Do not use 
other labs.  Feel free to ask non-15L students politely to leave.
• TAs and tutors will be available until 5:30pm at least.
Working in pairs
• Pick another student to be your partner.  
• In every lab, you must have a different partner.
• Use two chairs in front of one computer.
• You will both get the same scores for the lab.
Deadlines
1. Quiz at 3pm every Wednesday.
2. Before 7pm same day: Email your joint lab notes.
3. Before noon Saturday: Email your joint report.
Lateness penalty: 25% of maximum per day (or part of day) late.
Example: For a report sent any time on Sunday, 50% penalty.
How to submit notes and reports
Email notes and reports before their deadlines.
Use plain ASCII text:  no attachments, no PDFs, no Word 
documents, etc.
See the handout for directions on formatting.
How to submit notes and reports
We have a special Gmail address.  Pay attention and use the 
right address, before the deadlines. 
Graded notes and reports will be emailed back to you.  Send a 
carbon copy (cc) to yourselves so we can do this.
Academic honesty
Cheating is unfair to other students.  We will punish it.
Cheating includes plagiarism.  Plagiarism means copying 
anyone else’s work without clear acknowledgment.
You may not use notes or reports from other teams, or from 
previous quarters or years.
The lab assignments are different this quarter, even if they 
look similar.
Class web site
Your responsibility: check the class web site regularly at 
http://cseweb.ucsd.edu/~elkan/15L
Find Java code for the first lab at  
http://cseweb.ucsd.edu/~elkan/15L/Alphabetize.java
Do not use copy-and-paste to get the code.  Use the Linux 
command
wget http://cseweb.ucsd.edu/~elkan/15L/Alphabetize.java
Message board
Feel free to email any of the course staff with questions.
But, if your question is not personal, use the message board at  
http://www.quicktopic.com/46/H/SEB8Mu7M2w7F
Linux and Eclipse
The first few labs will use the Linux command line.
• Every software engineer needs to be comfortable with this.
Later labs will use the Eclipse IDE (interactive development 
environment).
• IDEs increase productivity.
How to compile Java
Use the command    javac Alphabetize.java
Error messages are symptoms of syntax defects.
If not, a file named  Alphabetize.class  is created.
How to run a Java program
Use the command    java Alphabetize [args]
The notation [args] means optional arguments.
Always be sure that you are running the latest version of your 
program!
What does the notation [input [output]] mean?
What to do in the first lab
Task: Find and fix four bugs in Alphabetize.java
Write step by step notes about what you do, at the same time 
you are doing it.  Submit these notes immediately when you 
are finished.
The report for the first lab
One interesting bug in Alphabetize.java is an “out of 
memory” issue.  In your report, explain your thought process 
while finding and fixing this one bug. 
Notes should be about all bugs, but the report should be about 
only this one bug.  
The report must be written in good English, with complete 
sentences and paragraphs.
Scores are based on completeness and clarity, not on length.
See on the website
• An example of good lab notes
• An example of a good report
• The guidelines that we will use for grading
• The buggy code for today’s lab
• The instructions for today’s lab (same as the handout)
Working in pairs
• Pick another student to be your partner.  In every lab, you must 
have a different partner.
• Write notes at the same time you do debugging.
• Email the notes with both your names today, before 7pm.
• Plan to finish your report jointly by Saturday noon.
• You will both get the same scores for the lab.
Next week...
Next week I’ll talk about the scientific method: hypotheses, 
experiments, predictions, etc.
You will be able to compare the scientific method with your 
thought process from this week’s lab.
Let’s go!
Please move to the labs now: B230, 240, 250 and 260.
Pick a partner and get started.