Assignments:
|
Name |
Description |
Due Date |
|
|
Adding to the Ticket Machine |
Download the Chapter02 folder from the share and open up the Naieve Ticket Machine Project. Add functionality to the ticket machine in order to have a method that will give the value of the total money collected by the machine. |
Wednesday 2/14 |
|
|
Giving Change |
Modify the printTicket method. The print ticket method should now do the following: · Print out the ticket of the appropriate price · Add the amount of money inserted to the total · Return the remaining change (if any) to the user and reset the balance to 0 You may need to make modifications to the method header as well as the code for the method. |
Thursday 2/15 |
|
|
Adding a Prompt |
Add a method called Prompt to the TicketMachine class. This method should have a void type and take no parameters. The body (code) of the method should print out “Please insert the correct amount of money” when the balance of the machine is not enough to cover the cost of a ticket. |
Friday 2/16 |
|
|
Show Price |
Add a show price method to the TicketMachine class. This method should display “The price of a ticket is ____ cents” where the blank contains the appropriate ticket amount. |
Friday 2/16 |
|
|
Empty Machine |
Implement a method empty that simulates the effect of removing all money from the machine (sets the total back to 0). |
Tuesday 2/20 |
|
|
Book 1 |
Below is the outline for a Book class which can be found in the chapter 2 projects folder you downloaded from the share. The outline has two fields and a constructor declared. Add two accessor methods to the class – getAuthor and getTitle – that provide information about the author and title fields of Book. |
Thursday 2/22 |
|
|
Book 2 |
Add two methods, print Author and printTitle to the outline of the book class. These methods should print the information to the screen. |
Friday 2/23 |
|
|
Odd Even |
Write a class called CheckNumber that has a single int parameter in its constructor and prints a message to the screen telling if the number is odd or even. |
Tuesday 2/27 |
|
|
Areas |
Download the Areas folder from the share and complete the methods inside as specified. |
Tuesday 3/6 |
|
|
Book 1 |
Decide on another piece of information that a book should store. Create a field for that piece of information and an accessor method for the field. |
||
|
Book 2 |
Create a toString method that returns all of the details of the book in string form. |
||