46
BIT115: Introduction to Programming Lecture 11 Instructor: Craig Duckett alf of Winter Quarter 2016 B

Lecture 11 Instructor: Craig Duckett. Announcements Assignment 1 Revision DUE TONIGHT February 10 th In StudentTracker by midnight If you have not yet

Embed Size (px)

DESCRIPTION

3 Assignment 2 GRADED! RETURNED! WOOT! WOOT! Assignment 1 Revision (LECTURE 11) DUE TONIGHT ! Wednesday, February 10 Assignment 2 Revision (LECTURE 12) Wednesday, February 17 Assignment 3 (LECTURE 13) Monday, February 22 Assignment 3 Revision (LECTURE 16) Wednesday, March 2 Assignment 4 (LECTURE 19) Monday, March 14  NO REVISION Extra Credit 01 (LECTURE 20) Wednesday, March 16 Assignment Dates (By Due Date)

Citation preview

Lecture 11 Instructor: Craig Duckett Announcements Assignment 1 Revision DUE TONIGHT February 10 th In StudentTracker by midnight If you have not yet submitted an Assignment 1, this is your last chance to do so to earn points, otherwise you will get a zero, and I really dislike handing out zeros! NO CLASSES ON MONDAY, FEBRUARY 15 th ! College Closed! College Closed! Presidents Day! 3 Assignment 2 GRADED! RETURNED! WOOT! WOOT! Assignment 1 Revision (LECTURE 11) DUE TONIGHT ! Wednesday, February 10 Assignment 2 Revision (LECTURE 12) Wednesday, February 17 Assignment 3 (LECTURE 13) Monday, February 22 Assignment 3 Revision (LECTURE 16) Wednesday, March 2 Assignment 4 (LECTURE 19) Monday, March 14 NO REVISION Extra Credit 01 (LECTURE 20) Wednesday, March 16 Assignment Dates (By Due Date) But First The Quiz! The Quiz! Mid-Term Post-Mortem TODAY BEGINS THE SECOND HALF OF THE QUARTER -- WHAT DOES THIS MEAN IN THE COSMIC SCHEME OF THINGS? Less Theory, More Hands-On Work (Less means Less, not No) Less Hand-Holding, More Trial-and-Error Less Explanation, More Research & Investigation, More Poking Around For Code, More Googling It and More (on occassion) Aggravation. Grrrr! When You Do Get Aggravated: Remember to STEP AWAY from your code occasionally, take a break, walk around, go and eat, contemplate the great outdoors, then come back. If it is late at night, go to bed. You may discover that bizarre thing that sometimes can happen, where you DREAM IN CODE, and wake up in the morning refreshed and with the beginnings of a solution! INPUT: Scanner Class REVIEW nextInt() Assumes there is an int and does something with it hasNextInt() Checks to see if there is an int (boolean true or false) nextLine() Replaces the int in the keyboard buffer with a newline character (Enter) so the program won't use the int again import java.util.Scanner; or import java.util.*; Scanner keyboard = new Scanner(System.in); Input Scanner The Scanner Class To read input from the keyboard we use the Scanner class. Like Random, the Scanner class is defined in the Java Library package called java.util, so we must add the following statement at the top of our programs that require input from the user: import java.util.*; // anAvenue; // the same and with any } // number being entered In main youd call it this way: this.isPastAvenue(anAvenue ); Using a While Statement with a Parameter The following method moves a robot east to Avenue 18. public void moveToAvenue18() //