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.