Java Programming

 

      

 

Friday, January 10th

 

Check your grades!

Free Computers! - not working but all the parts are there. Great starter if you wanted to play around with Linux.

Be sure all programs have a statement explaining what the program does.
Your output for the GallonsToLiters program should look like this:

Welcome to my Gallons to Liters converter.
Please enter the number of gallons.
10
10 gallons is equal to 37.8541 liters.
Thanks for using this program which is brought to you by C. Dodge.
Have a great day.

Review of Lesson 1:
To get input from the user you must create a scanner object:
Scanner myNewScanner = new Scanner(System.in); - you then use that scanner object to get the user input and assign it to a variable.
mpg = myNewScanner.nextInt();
Remember you must use the Import statement in order to use the scanner object:
import java.util.Scanner; - place this at the top of your code

To print output to the monitor you use the following:
System.out.println("Your text goes here" + variableNameHere + " more text.");

Complete Section 4: Lesson 2 - Object and Driver Classes Programs - show these to me for teacher check. Before you leave class today all of lesson two should be finished and you should have shown me your two programs, Student and Person classes with their driver classes. See the Oracle curriculum.
The output of the StudentDriver class should be in the following form:

Student Name: Caron Newman
Student ID: 123456789
Student Status: Active

This program was created by .....



Section 4: Lesson 2 - Object and Driver Classes Vocabulary
- A group of related Java classes.
- Sections of code that are enclosed inside a set of curly braces. {}
- First letter uppercase and the first letter of each internal word capitalized. Example: SavingsAccount
- A named value that does not change.
- First letter lowercase and the first letter of each internal word capitalized. Example: studentFirstName
- A class that contains a main method.
- A code statement in a Java class file that includes java code from another package or class.
- A class that defines instances of objects to be used in another class.
- Code that is preceded by //. Comments are used to clarify programming logic. Comments are ignored by the compiler.
- A word that has a special function in the Java language, and cannot be used as names for classes, methods, or variables.
- The library of Java classes available to import into a programmer-created class.
- The outline of an object, including class variables, constructors, and methods.
- A special kind of method that is a template for an object.
- Values that are sent into a method or constructor to be used in a calculation or substituted with values from the class.
- Values, such as numbers, characters, or booleans. References to objects, such as a BankAccount object.



 

Homework

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

 

What

Objectives for Section 4 Lesson 1
In this lesson, you will learn how to:
• Identify components of Eclipse
• Compile an application
• Test to ensure application is complete
• Write the code for GalToLit.java
• Continue coding until error free compilation and execution is reached
• Modify the program to compute a different number of gallons into its equivalent number of liters

 

Why

Eclipse is an efficient and easy to use a development environment for creating Java programs. It is a well known tool by many Java programmers and is used in many development environments.
Learning Eclipse in this lesson will give you additional skills with tools used in the Java programming space.

 

How

By completing the slides, quiz and practice exercises.