Java Programming

 

     

 

Thursday, March 12th
Flex Schedule

 

Destined for X Summer Program - week long all expenses paid summer program for underrepresented students.

Section 5 quiz will be tomorrow. Take the quiz before then as practice.

All of 5.2 assignments are due tomorrow.

Message from former student:

I just wanted to say that your Java class helped me a ton in the long run.  My comp sci class is a breeze and purely review; it's awesome how easy it is.  We're only on arrays right now.

Section 5 Project - start with your Section 4 Project
- Prompt the user for the data needed to create a new product for your store.
- Use the data the user has provided to create the new product.
- Repeat to create a second new product.
- Discontinued - create a boolean variable to indicate if a product has been discontinued - no more will be ordered.
- Stock Value - create a method that calculates the stock value of an item.
- Update your toString() method to include Status and Stock Value.
- Demonstrate your program for teacher check.

Anagram Hints:
Be sure to check the Java API for the String methods that you can use. One of the things you will need is the length of the word or phrase so you know how many letters you are dealing with. You will also need to know the index of each character since you will be comparing characters.

Here is how the indexOf( ) method works

Here is how you check to see if a character is found in a string: if (word2.indexOf(c) = = -1) - if you every get a -1 that means that character is NOT found in the string and thus you do NOT have an anagram. You will need to use a loop to pull out each character in the first word and see if it is in the second word.

Section 5 Lesson 2: Control Statements Vocabulary:
- A post-test loop that executes an unknown number of times until a condition is met, but always executes the first time through the loop.
- A pre-test loop that uses an iterator to keep track of how many times a loop will execute.
- A keyword used to skip over the remaining code in a loop and return program control to the beginning of the loop to execute again.
- A pre-test loop that executes an unknown number of times until a condition is met.
- A keyword used to terminate a loop from executing before the loop condition is met.

Complete work on the Section 5 Lesson 2: Control Statements practice.
Section 5.2 Coding - finish up the 1. Decoder program - you must use only one println to print out the decoded message. Be sure an appropriate message is displayed if I type in a number out of range.

Complete Section 5 Lesson 2: Control Statements project. Demonstrate for teacher check.

Section 6 Lesson 1: Arrays Vocabulary:
- The act of progressing through an array
- A structure that stores multiple values of the same data type
- A two-dimensional array.
- An integer that identifies the location of a value in an array
- The ability to pass data into the main function and access it as an element of an array.
- A logical computational procedure that if correctly applied ensures the solution of a problem
- An array of arrays, similar to a table, matrix, or spreadsheet.
- A for loop inside of a for loop
- A named object used to store more than one value.

 

Begin Section 6 Lesson 1: Arrays slides
Complete Section 6 Lesson 1: Arrays questions 1-6.
Complete Section 6 Lesson 1: Arrays programs - ExamAverage, Matrix and CardDeck

 

 

Homework

Install Eclipse on your home computer if you would like to be able to work on your java at home.

 

What

In this lesson, you will learn how to:
•Recognize the correct general form of a class
• Create an object of a class
• Describe object references
• Create methods that compile with no errors
• Return a value from a method
• Use parameters in a method

 

Why

Class templates are the foundation of the Java language. Understanding how to create a class with various methods will be essential to becoming a good Java programmer. Knowing how to instantiate an object and compare it to other objects is critical to learning to use and work with Java data types.

 

How

By completing the slides, quiz and practice exercises.