- Log onto cs.bridgewater.edu.
- Create a new directory named Assignments in your repository.
- Change directory to your Assignments directory.
- Create a new directory named A2 inside Assignments.
- Change directory to your A2 directory.
- Create a java class named Item according to the following specifications.
- The class has 2 fields that hold the description of the item (String) and cost (double).
- The class has one constructor that sets the description and cost.
- The class has setters and getters for the fields.
- Create a driver class named Test according to the following specifications.
- When the program starts, the program creates two instances of the Item. The first instance has the description “Pencil” with a cost of $0.99, and the second instance has the description “Notebook” with a cost of $2.49.
- The program prints to the screen the sum of the costs for the items using the getter methods.
- When finished writing, testing, and debugging your code, push your files to GitHub.
© 2018 – 2019, Eric. All rights reserved.