CS 302 Lecture 6 Home Page

Fall 2013, LECTURE 6 HOME PAGE

Lecture Information | Lecture Announcements

Lectures

Instructor

Matthew Bernstein

Class Content

Lecture Slides

0. Course Overview
1. What is Programming?
2. Introduction to Java
3. Primitive Variables
4. Strings & Reference Variables
5. Decisions - The "if" Statement
6. Boolean Variables & Conditional Expressions
7. The "while" Loop
8. The "for" Loop
9. Input Validation
10. Arrays
11. Bubble Sort
12. 2-Dimensional Arrays
13. Methods
14. Common Array Algorithms
15. Recursion
16. Array Lists
17. Intro to Object Oriented Programming
18. Constructors
19. Default Values & The null Reference
20. Tester Classes
21. Static Variables and Methods
22. toString, equals, hashCode
23. Inheritance
24. Polymorphism
25. File I/O
26. Command Line Arguments
27. Exception Handling
28. Interfaces

Class Examples

HelloWorld.java
PenniesToDollars.java
TemperatureConverter.java
TargetBalance.java
RockPaperScissors.java
Fibonacci.java
AsteriskSquare.java
AsteriskStairs.java
AsteriskDiamond.java
MeanMedianMode.java
MeanMedianMode_Methods.java
ArrayAlgorithms.java

Connect Four Program:

Main.java ConnectFour.java GameGrid.java Column.java Player.java

Trivia Question Game:

Main.java QuestionReader.java Question.java MultipleChoiceQuestion.java ReadQuestionException.java

Interfaces Example:

Main.java Meausureable.java Container.java

Study Material

Midterm 1:

Midterm_1_Terminology
Notes on input validtion
Input validation exercise
Loop tracing exercise

Final:

Exception Tracing Exercise
Final Review: Calculator Program

Cool CS Links

Code.org's video on why everybody should learn how to code
Visualizing Facebook's global network
TIME Magazine "2045: The Year Man Becomes Immortal"
A look into Google Glass
Ramesh Raskar: Imaging at a trillion frames per second
3D Imagery for Google Earth
60 Minutes interview with Elon Musk
How PhotoSynth can connect the world's images
Using a supercomputer to simulate the human heart
Using a supercomputer to simulate biological evolution
Homepage for Android developers
A look at Google's self-driving car
How psuedorandom number generators work
Robotic arms controlled by the human brain
Self assembling cubes
Proving Fermat's Last Theorem
What is Quantum Computing?
Seeing the Earth from Space

Lecture 6 Announcements

Week 11: General Course Announcements

Exam 2: Thursday, 11/14, 5-7 PM.

  • See Exams page for Room assignments.
  • Bring your UW ID and #2 Pencils
    Links: Exam Information, Topics List, and see the "Content" section of the course Learn@UW page for sample questions and a previous semester's exam.

Week 11, Thurs.: Exam Review

Bring a copy of sample exams if you wish to follow along with questions.

  • Object Diagram (for P3): P3_ObjectDiagram.pdf Try making your own before reviewing this partial diagram of the relationships between objects in P3.

Week 11, Tues.: Arrays of Objects Review, Exam Review

Week 10: General Course Announcements

Week 10, Thurs.: Finish Ch. 8.7 - 8.11, Program 3 demo and milestones 3-5

Week 10, Tues.: Continue Ch. 8.5 - 8.7

Week 9: General Course Announcements

  • Program 3 is due by 10 PM on 11/22 (see Programming Assignments link). Submit a working version of program 3. Comment out (but do not delete) incomplete/non-working code.
  • P3 pairs are due before 10pm on 11/15.
  • Program 2 will be graded and your grade reports can be viewed by using the 302 Forms Page. If you believe there was an error in the grading of your program, please contact by 11/8 the TA listed in your grade report.

Week 9, Thurs.: Finish Ch. 8.1 - 8.5, Start 8.6 - 8.11, Program 3 Released

Code Samples: Course.java, Date2Driver.java, Date2.java, Cup1Driver.java, Cup1.java

Week 9, Tues.: Start Ch. 8.1 - 8.5
Code Samples: Student.java, Date1Driver.java, Date1.java

Week 8: General Course Announcements

  • Exam 1 Grade Reports were returned in lecture and scores have been posted on Learn@UW. Regrade requests must be reported by 10/25.
  • Program 1: scores have been uploaed to Learn@UW. Confirm that we have the correct score in Learn@UW.  Report descrepances by email to your grader TA and include your Name, Net ID, and CS Login.

Week 8, Thurs.: Finish Ch. 6.8

Code Sample: P2 Demo

Code Sample: ArrayListDemo.java

Week 8, Tues.: Read Ch. 6.8, Program 2 due, Exam 1 Returned

Exam 1 Results:

High: 100/100
Ave: 80.15/100

Your scantron report shows these three columns:
ITEM - the question number
KEYS - the correct answer
YOURS - your answer (if you missed this question)

Week 7: General Course Announcements

  • Exam 1: 10/17, 5-7 PM.
    • Bring your UW ID and #2 Pencils
    • See Exam Links: Exam Information, Topics List, and
    • See the "Content" section of the course Learn@UW
      page for sample questions and example exam.

Week 7, Thurs.: Review Fall 2012 Exam

Week 7, Tues.: Finish 6.4: passing arrays to methods, Program 2 Overview, Review Exam Info/Bring Sample Questions

Week 6: General Course Announcements

  • Program 2 has been released. Register your p2 teams before 10pm on 10/18. 

Week 6, Thurs.: Read Ch. 6.4 - 6.5

Thursday's Lecture Example Code: getValidInteger.txt, CallStackTrace.java
Sample Exercise 1: Methods.txt
Sample Exercise 2: CallStackTracing.txt

Week 6, Tues.: Read Ch. 5.3 - 5.7

Exercise: Convert this java program so that is uses methods: RectangleArea2.java Code Solution: RectangleArea3.java
Code Fragment Sample: Methods.txt

Week 5: General Course Announcements

  • P1 is DUE before 10pm on Friday 10/4

Week 5, Thurs.: Read Ch. 5.1 - 5.2

  • more on one dimensional arrays
  • intro to methods

Week 5, Tues.: Read Ch. 6.1 - 6.3

  • Discussed differences between loops and several forms of incrementing variables:
      count = count + 1
    ;
      count += 1;

      count++;
      ++count;
    DO NOT MIX AND MATCH:
    For example, do not use something like this: count += count++
  • Shapes.java - Displays a diamond shape based on value in n.

Week 4: General Course Announcements

  • P1 Teams must be registered (created and joined) before 10pm on Friday 9/27.
  • The second group of CodeLab exercises has been assigned. See the announcement section of the CodeLab page for due dates. Note the bulk of the exercises are done in these early chapters so get started now to take maximum advantage of CodeLab for extra credit. For more information see Extra Credit.

Week 4, Thurs.: Finish Ch. 4

Exercise: Modify HiLo3.java (linked below) to play multiple times. Code Solution: HiLo4.java

Code Solution: OneDArrayExample.java
NestedLoopExamples.java
NestedDoLoopExample.java
HappyValentinesDay.java

Code Output: HappyValentinesDay.output.txt

Week 4, Tues.: Continue Ch. 4, we'll also discuss Input Validation

Exercise: Write a Java code fragment that determines if a date is in the past, present, or future. You are given integer variables year (>0) and month (1-12), which you may assume will have valid values. You are also given constants YEAR and MONTH that represent the current date. First, solve the problem for the year only, then modify it to work for both the year and month.

Challenge: Assume you also have an integer variable day (1-31) and a constant DAY. Write the code fragment to work for a complete date.

Week 3: General Course Announcements

  • Domestic students: Make sure to get your free voter ID card!
    For more information see: UW News Article and Voter Information.
  • Your lab scores can now be viewed on Learn@UW. They are updated weekly (by Friday).
  • Students MUST report Exam Conflicts and any other (Religious,Sports Travel, and McBurney) accomodation requests for the ENTIRE SEMESTER by this Friday 9/20:
  • Use the CS 302 Forms to report a conflict with any of the exam dates (see Exam Information).
  • McBurney students must give a copy of your VISA to Deb Deppeler by Friday 9/20.
  • Do you have a programming assignment question? Use Piazza. For more information about using Piazza.
  • Need Help with CS 302? See the information about Lab Consultants with a link to the lab consulting hours.
  • The first group of CodeLab exercises has been assigned. Due dates are posted in the announcement section of the CodeLab page. Note the bulk of the exercises are done in these early chapters so get started now to take maximum advantage of CodeLab for extra credit. For more information see Extra Credit

Week 3, Thurs.: Finish Ch. 3, Start Ch. 4

  • Random values, seed, start input validation
  • Exercise: Complete your code fragment that determines how many days are in a month (e.g., February has 28). Assume month is an integer variable that has some value between 1 and 12 (i.e., January to December).

    Code Solutions: DaysInMonthCalculator1.java, DaysInMonthCalculator2.java

Week 3, Tues.: Continue Ch. 3 Decisions

Flow Chart to Code Fragment: flow_chart_code_fragment.png

Previous Semester Code Fragment Samples: Ball2RightP1.txt, Ball2RightP2.txt

Week 2: General Course Announcements

  • Labs begin this week: Complete Lab 1: Eclipse Tutorial
  • Register on the Forms page (login using your cs login account name and password) and enter any Exam conflicts or accommodation requests for the entire semester before Friday, Feb 8th.
  • Programming Assignment #1 has been assigned. See the information about Programming Assignments.Be sure to read and get started before class on Thursday. Bring questions to lecture next week.
  • Set up Java/Eclipse your own computer. See the Software Downloads page for instructions.

Week 2, Thurs.: Finish Ch. 2, Start Ch. 3

Week 2, Tues.: Continue Ch. 2

  • Last day to drop without notation on transcripts is this Wed 1/30.
  • Code Sample: FtoC.java. Sign up for CodeLab and see the Consultants for extra help during their posted hours

Week 1: General Course Announcements

  • Would you like to more programming practice and earn extra credit?
    See the CodeLab page. Note CS 302 offers students the opportunity to earn extra credit.
    For more information see Extra Credit.

Week 1, Thurs.: Start Ch. 2

Week 1, Tues.: Read Ch. 1

  1. Add the Exam dates and times and other Course Information to your calendar.
  2. Activate your CS account.
  3. Read the course website to ensure you know where to find information we post.
  4. Read the textbook before lecture as well as familiarizing yourself with the course website.
  5. See the Download link if you wish to work from home.
  6. Enroll in Piazza to ensure you see questions and answers that other students have posted.
  7. Printable Info Sheet

CS 302 Lab Sections will be held starting Tuesday, 9/10.

  • Textbook Information: We will use the SECOND edition of the Horstmann textbook.
  • WES-CS Sections will be held starting Tuesday, 9/3, for those enrolled in WES-CS.
  • Religious Observances: Notify Deb Deppeler by 9/20 via email if you participate in religious observances that may conflict with course requirements.
  • McBurney Accomodations: Give a copy of your VISA to Deb Deppeler by Friday 9/20 if you have any McBurney recommended accomodations.
  • UW Team Travel Accomodations: Give a copy of your travel letter and itinerary to Deb Deppeler as soon as possible to maximize the chance of an accomodation being possible.
  • Exam Conflicts: Report exam conflicts via the Forms tool before Friday Sept 20th.  The Forms tool will be available soon.
  • Note: Some CS 302 course pages are under construction, some links may not work. All links should be working by week 2, please let me know if there are any broken links after week 2.