Overview
This assignment will give you practice creating, compiling, and running short Java programs in the Eclipse IDE.
- Create, compile, and run short java programs
- Store data in variables of type int, double, and String
- Display output with basic formatting using System.out
LEGEND: Keyboard Screen
Task 0 Preliminaries
- You should have read Chapter chapter 2 sections 2.1 - 2.5 before completing this lab.
- Open Eclipse and create a new Project named Chapter2. Create all of the Java classes for this lab inside of this project.
Task 1 Gaddis201
- Complete programming challenge 1 on page 105 of the text.
- Name your Java class Gaddis201. (This will be standard naming for the next few labs: Gaddis chapter 2, programming challenge 01, hence Gaddis201.)
- Make sure you include a standard header comment (you can use this Java header comment template).
Task 2 Gaddis202
- Complete programming challenge 2 on page 105 of the text.
- Name your Java class Gaddis202.
- Include a standard header comment.
- Assign firstName, middleName, and lastName directly; then use the String.charAt(int) method to get the appropriate values for the variables holding initials (see p. 74).
Task 3 Gaddis206
- Complete programming challenge 6 on page 106 of the text.
- Name your Java class Gaddis206.
- Include a standard header comment.
- Store the values for total sales and east coast sales percentage in variables of type double. Choose appropriate names for the variables.
Task 4 Gaddis209a
- Complete programming challenge 9 on page 106-7 of the text.
- Name your Java class Gaddis209a.
- Include a standard header comment.
- One change from the task described in the text: Instead of asking the user for miles driven and gallons of gas, simply assign the values directly within the program. (We'll come back and modify this for the next lab).
Your submission should include screenshots of successful runs for each task along with the Java source files. (I.e., Screenshot201.jpg, Gaddis201.java, Screenshot202.jpg, Gaddis202.java, ...)
