Jump to Lecture 1, Lecture 2, Lecture 3, Lecture 4, Lecture 5, Lecture 6, Lecture 7, Lecture 8, Lecture 9, Lecture 10, Lecture 11, Lecture 12, Lecture 13, Lecture 14, Lecture 15, Lecture 16, Lecture 17, Lecture 18, Lecture 19, Lecture 20, Lecture 21

Information for Lecture 1 (Tuesday, 3/28/2017)

Today's lecture covers the Java language and Robot basis for learning programming.
First programming language graphic

Today's goals are to find where resources are available, and set up software. Please see direction in the left-hand frame.

Information for Lecture 2 (Thursday, 3/30/2017)

Today's lecture covers the basics of Java. We will see how to interpret a program, and how to 'debug' or fix errors in the program. Lecture notes are here.

There are three in-class exercises for today. If you haven't yet, Please start by setting up the jGrasp and JDK software. You will need to follow the directions (linked to the left) to download the becker.jar file, and set the paths in jGrasp.

The next step will be to download the class files, and exercise instructions in a subfolder of your BIT115 folder. Today will show you how to get started on a piece of code, but more importantly, you will have practice debugging and predicting the behavior of a computer program. Mastering these tools is what will allow you to master BIT115.

Lecture 3 (Tuesday, 4/4/2017)

Today we start writing more code. Lecture notes are here.
When you think about writing code, please think about these goals: 8 characteristics for great code Please note that the first test, worth 50 points, is NEXT Thursday. This test will cover things like the structure of a java program, tracing some code, and debugging some code. This test will not take the entire class period.

There are, again, a few exercises today. You will trace a program, debug a program, and write some code. Please download the following information, and get started with exercise 1.

Exercise directions
ICE_03_01_Trace
ICE_03_02_CompileErrors
ICE_03_03_WalkDownWalls
ICE_03_Demo
and an Example trace

Lecture 4 (Thursday, 4/6/2017)

In today's lecture we will be looking at printing information to the console window. This is really simple, and amazingly useful. Not only is it a step towards making your programs do real things, but, it can be quite useful as a debugging device (print out a value to double check that it is what you think it is. In class exercises below. Lecture notes are here.

When we use output we add a column to our trace table to record the output. You should practice tracing through the output demos below. Please do this by downloading a new trace table, and tracing as we did last week, but including any output information.
Hello World, and Output_demo

Practice: Start with the "Hello World" class. Change the code so that it prints out your name. Refer to the slide on formatting characters, and use this information to print out the line with the numbers with tab-intervals.
Use the ICE_02_02_Trace code you looked at last week (ICE_02). Add statements to print the position of the robot in the beginning, at the pickThing() line, the putThing() line, and at the end. Compare these print statements with the entries on your trace table - they should match. As an added challenge, print out the location of the Thing at the end of the program. (Save this code - you will submit it for mini-assignment 2.)

Lecture 5 (Tuesday, 4/11/2017)

This class is the beginning of writing flexible code: We learn decision points. Lecture notes are here.

Files and instructions for in class exercises are below. You should spend time working on these exercises in class, and will also want to be sure to complete this week's mini assignment.

Instructions
I_04_If, ICE_04_1_Errors, ICE_04_Demo_01, ICE_04_If_Else
Trace example

Lecture 6 (Thursday, 4/13/2017)

We review while loops and discuss primitive data types and declaring variables. Lecture notes are here.

Due to the test today, we may not have time to work through the following exercises. However, I encourage you to give them a try - we will be revisiting them in the coming week.

ICE 5 instructions
If-else example document, while loop example, While loop concepts
Java code: HallwaysWhile, ICE_05_Avenues, ICE_05_Demo, ICE_05_Race, Example race solution, ICE_05_Trace

Test

Lecture 7 (Tuesday, 4/18/2017)

In this lecture we will be continuing to work on use of local variables and while loops. We will also cover predicate methods, which are useful for use in control-statements such as if/else and while loops. Lecture notes are here.

Exercise instructions
Documents: CountingLoop Trace, ICE_05_02 Trace
Java code: ICE_05_CL_Trace, ICE_05_Count, ICE_05_Demo

Lecture 8 (Thursday, 4/20/2017)

Today's class covers parameter variables. Lecture notes are here.
You should also look at this completed version of WalkDownWalls for examples of comments. Future assignment will require commenting.
As usual, exercises and java files are below.

Exercise instructions and example trace.
Demo 1, and Errors 1.
Extra: Method Overloading

Lecture 9 (Tuesday, 4/25/2017)

Today's class covers getting user input. Lecture notes are here.

Exercise instructions and example trace.
Basic Keyboard IO, , ICE 05 IO, ICE 07 Output, Simple Keyboard IO, Fix Keyboard IO.

Lecture 10 (Thursday, 4/27/2017)

Today is a day of review, and Test 2.
Please come prepared with questions - review mini-Assignments, and work on Homework 1.

Example file of fun robot activities: GameSim

Lecture 11 (Thursday, 5/4/2017)

We talk about class variables. Lecture notes are here. As usual, exercises and java files are below.

Exercise instructions and example trace, and another.
ICE_06 Errors 2, Demo 1, Demo 2, Remembering Robot

Lecture 12 (Tuesday, 5/9/2017)

This lecture is about strings. Lecture notes are here. Here are some some string example files.
String Demo,
Getting String,
Reverse String,
String Arrays,
String Length,
String Literal,
String Methods,

Lecture 13 (Thursday, 5/11/2017)

Today we discuss overriding methods. Methods from a super class are inherited by a subclass, and can be overridden to behave more specifically to the subclass. Overriding allows java to be polymorphic Additionally we will look at making programs using multiple classes and files. Lecture notes are here.

If you are interested in more information about classes, there is a lot of information here: http://www.javaworld.com/article/2979739/learn-java/java-101-classes-and-objects-in-java.html

Demo 1 Overriding exercise and Code to trace
Look at this example trace after you have done yours.
Safer robot demo
Multi-file exercises
Harvester class, HarvestTask, Harvest.txt

Lecture 14 (Tuesday, 5/16/2017)

New types of loops - for loops. Lecture notes are here.

Exercise Description
Java files for ICE_15_For, and Nested While, and Printing Shapes
Documents: Trace Starter and Trace solution

Lecture 15 (Thursday, 5/18/2017)

Review and test. Please bring pencils.

Lecture 16 (Tuesday, 5/23/2017)

Introduction to Arrays: We will cover arrays as objects, and using arrays as parameters. Lecture notes are here.

Exercise Description, and and more exercises.
Java files for ICE_15_For_4, and ICE_15_For_1 and ICE_17,
and Arrays with Loops, and Printing For
Demonstration Code

Lecture 17 (Thursday, 5/25/2017)

More arrays. In this class we will be covering some more details, including examples of arrays of objects, processing arrays, and passing arrays around. Lecture notes are here.

In class exercises are here: Basic array exercises, and Array parameters, and Array passing exercises. Java files for Fill Array, Find in Array, Find Max, Print Array, Array Methods, Array Loops
Some sample code: Array Demo

Lecture 18 (Tuesday, 5/30/2017)

Lecture notes are here.

In class exercises for today are to review your previous assignments and tests.

Lecture 19 (Thursday, 6/1/2017)

Today we are reviewing for the final exam. Please come prepared with questions.
A good start is to review your tests and assignments.

Lecture 20 (Tuesday, 6/6/2017)

FINAL EXAM Please bring pencils!

Lecture 21 (Thursday, 6/8/2017)

We will review the final exam, and reinforce your mastery of these topics.
(And, yes, attendance will be taken.)

<--- --->

Jump to Mini-Assignment 1, or Homework Assignment 1

Lecture Date Topics Reading / Assignments
1 Tuesday, March 28 Course Intro
Java
Karel the Robot
Ch. 1
2 Thursday, March 30 Compiling and Executing
Types of bugs
Debugging and debug tables
Tracing a program
Ch. 1.5 & 1.4
Mini #1
3 Tuesday, April 4 Extending a class Ch. 2.1, 2.2, 2.4
4 Thursday, April 6 Printing to the console
Non-robot programming
Ch. 6.6
Mini #2
5 Tuesday, April 11 Decision Points: 'if' and 'if-else' Chapter 4.1, 4.2, 4.4
6 Thursday, April 13 Repeating Statments - 'while' loops
Data types and temporary memory.
Chapter 4.1, Chapter 5.2 & 5.8
Mini #3
Assignment 1 due.
Test 1: Java Fundamentals
7 Tuesday, April 18 Counting while loops
Predicate Methods
Chapter 4.1, 4.2, 4.4, 4.5
8 Thursday, April 20 Arguments to Methods (Parameters) Ch. 4.6, 6.2
Mini #4
9 Tuesday, April 25 Reading User Input Ch. 9.4-9.5
10 Thursday, April 27 Review Test 2: Extending classes
Mini #5
NL Tuesday, May 2 No Lecture Today
11 Thursday, May 4 Instance Variables
Variable types
Ch. 6.1-6.3
Mini #6
12 Tuesday, May 9 Srings and enumerated types C. 7-7.3
13 Thursday, May 11 Over-riding inherited Methods
Programs in Multiple files
Ch. 6.2 & 4.4
Mini #7
14 Tuesday, May 16 For loops
Assignment 2 due.
15 Thursday, May 18 Review Mini #8
Assignment 1 re-write due
Test 3: Class Attributes
16 Tuesday, May 23 Arrays Ch. 10-3
17 Thursday, May 25 Arrays as Parameters
Arrays as Return Values
Mini #9
18 Tuesday, May 30 Array tricks & details
Arrays of Objects
Ch. 10-10.5
Assignment 3 due.
19 Thursday, June 1 Review for Final Exam. Mini #10
20 Tuesday, June 6 Bring pencils. FINAL CUMULATIVE EXAM
21 Thursday, June 8 Review Final Exam Attendance is taken.
All Assignment Re-writes Due



Mini-Assignment 1

Download the FindErrors.java file, which is provided for you as part of today's In Class Exercises.
You should record each and every error that you find in your own copy of the Program Debug Table (which you should download from the course website).
You should also save your own personal copy of the Program Debug Table (name it FindErrors or something similar), and record the errors that you find in that. Submit a copy of the completed debug file via Canvas.

Download the ICE_02_02_Trace.java file, which is provided for your as part of today's exercises.
You should download a copy of the Program Trace Table from the course website, and use this table to trace every line in the ICE_02_02_Trace code.
You should save your own personal copy of this trace table (use an informative name), and submit a copy of the completed table via Canvas.

Mini-Assignment 2

Today's assignment will require the submission of two pieces of code. You may submit them together, or as you complete them. Please upload the files with the ".java" extension. Code should compile as it is submitted. You should also upload the debug table from today's exercises.

Submit the modified ICE_02_02_Trace code that you created on Tuesday. The new version should include output statements showing the robot positions. (10pts)
Submit the WalkDownWalls code that you were working on today; please submit anything you have completed. (10pts)
Submit the debug table completed during today's exercises. (5pts).

Mini-Assignment 3

For this week's mini-assignment, please start with the WalkDownWalls code that you submitted last week. (Or download this completed version: WalkDownWalls). Add two new methods/services/functions to the RobotThatCanWalkDownWalls that 'safely' picks up and puts down a thing. Use these new methods in the main method of this file.

putThingSafer should be implemented as described in part 3 of today's in class exercises.

pickThingSafer should use a conditional to determine whether it can pick something up (hint: Robot supports canPickThing, which returns a boolean value). If your robt can pick up a thing, it should. If it can't (else), it should print a statement saying "There is no Thing here."

Before you hand in your code you can test it by calling pickThingSafer once when the Robot is on a Thing, and once when it is not. Your submission for mini-assignment 3 is the WalkDownWalls.java file.

Mini-Assignment 4

In the first part of this assignment you should download ICE_05_Count.java from today's in-class-exercises. Please complete a debug table for this file. When you are done please submit both the debug table and the corrected code (java file).
Please download the RelayRace file. In this file three robots start on random avenues. Each robot will be located on the street (east-west road) pictured above, but may start in a different avenue. However, karel (the left most robot) will always start left of the other two robots. bob will always start between karel and mary, and mary will always start to the right of the other two.
You should complete this program so that the three robots complete a relay race such as the one described in comments in the code. For this mini-assignment you should pay close attention to methods/services you are asked to create in the comments, and use them to complete the program.

Mini-Assignment 5

Step one for this assignment is to complete the debugging of ICE_06_Errors_1, as described in Lecture 8. Please submit the debug table and the corrected java source code. You do not have to complete circleDots, but it might be good practice if you do.
Please download the BIT115Course1 code. There are a number of comments in this code describing how to complete it. You will be finishing the definition of a new method that requires two parameters, and returns one value. You will also be writing code to read in values for the two parameters. Please note that this is non-robot code.
Hints: if you have trouble figuring out what to do, make sure you start with the suggested code, and read the comments carefully. Start by filling in things that you can do easily, compile, and try to run. You can also look at the rubric on Canvas to see what criteria I'll be using to grade this mini-Assignment. As usual, I am most interested to see you demonstrating the material we have covered in class this week.

Mini-Assignment 6

For this mini-assignment you will submit Part 3 of the in-class exercises. Please note: You will be working with ICE_06 Errors 2, and you will need to first debug the code.

Mini-Assignment 7

Please complete the trace table exercise from Lecture 13 (Code to trace)

Please download the updated BIT115Course2 code. Follow the steps below, and then submit your completed version of the code.
Take things step by step. Between each step compile and run your code. Sometimes two steps go together, but you ought to be able to test one method before moving to the next method. You should also be sure to read the comments, and to notice when you can just uncomment code instead of creating it from scratch.


When you run your code you should see it retrieve your name, greet you, ask you to enter two grades, and then print out the average grade.

Mini-Assignment 8

For this week's mini-Assignment you should start with the in-class exercises for Lecture 14. In particular, for this mini-Assignment, you will submit the Printing Shapes code. You should complete at least up to Part 5: Printing a Rectangle, With a Subcommand. Notice that, when you download the code, the PrintRectangle method is stubbed out for you (eg, there, but not complete). You should be sure to complete the subcommand, and call it from the main method to demonstrate that it works. You should use 'for' loops in this subcommand. You should also query the user to get the size of the rectangle - try entering different dimensions to ensure that the code will work with any reasonable numbers.
Please refer to the rubric to see grading criteria. I will be checking that you implemented the correct function, used the correct technique, and commented your code appropriately.

Mini-Assignment 9
This week's mini-Assignment will focus on practicing 'for' loops, and arrays. Arrays are often confusing, so please take the time to work through as many in class exercises as possible. For your grade I would like you to complete the following:
Mini-Assignment 10

This is our final mini-assignment using the BIT115Course example. You should do two things minimum - first you should implement a 'getMax' method - find the comments in the code to see where, and you can refer to the getMin method that is completed to get an idea of how to do this. Second you should implement printGrades. You should spend some time on formatting and additional text to describe the output, and you should be sure to call the calcAverage, getMin, and getMax methods and include those summary values in your printout.
You should start with BIT115Course4.



Homework Assignments: There are three homework assignments worth 100 points each. You are strongly encouraged to work on these assignments with a partner. Each partner will recieve the same grade. Each assignment is due at 11:59 on the due date. Each assignment may be resubmitted once after it is graded to re-write portions. The final grade will be the best out of the two grades.

Homework Assignment 1

Exercise your Fundamentals

This homework will contain a series of exercises to re-enforce the concepts from the first portion of this course. The homework description and links to necessary files is here.

Homework Assignment 2

MazeBot: In this assignment you will create a new class of Robot that can navigate a randomly generated maze. The product of this assignment is one java program, and one document the details the solution contained in the java program. The initial program and directions may be found below. Assignments will be handed in via Canvas.

Some hints:
  1. Notice that the MazeBot is extending RobotSE, not Robot. You can find the documentation for RobotSE on the web page, and you will find, among other things, that is has a turnRight() service.
  2. You will want to retain a count of the number of times a MazeBot moves in any given direction, and this is precisely the type of thing that instance variables are good for. (They will retain their values for the lifetime of the instance.)
  3. The comments in the existing code will help you determine how to structure your program. Another exercise is to solve the maze yourself, by hand, and notice what processes and decisions you make. (But remember that the MazeBot can't look ahead very well.)
  4. You may create many helper methods. A method exists to perform a very specific task, or return a very specific piece of information. It is a great idea to create a helper method for each step of your solution (e.g, chooseDirection, moveSafely). You will be graded on how well organized your code is.
  5. The successful project will be fully commented and documented.
Directions
Maze java class
Some code to generate random mazes; I'm not promising it is perfect!
It has since been pointed out to me that becker.jar contains the MazeCity class, which extends city. You may also use this class to generate test mazes.

Homework Assignment 3

Histograms and Guessing Games. In this assignment you will create one robot code (Histograms!), and one non-robot code (GuessingGames!). These projects will allow users to practice a variety of concepts from this quarter, as well as focus on understanding arrays. The successful programs will be fully commented and documented. You are encouraged to work in teams of two or three. Your submission will include three java files.

The homework description and links to necessary files is here.