We will use the review exercise below to provide an example for our first recitation discussion. All students are required to carefully review the provided starter code and come prepared to Wednesday's recitation session with written answers to the following questions:
- How many instance variables are contained in the
Money
class? How can you identify an instance variable? - How many instance variables are contained in the
Wallet
class? Can you think of any other instance variables that might make sense to add to theWallet
class? - There are four unimplemented methods (2 methods, 2 constructors) in the
Wallet
class. What is the purpose of each of those methods? - Watch the introductory video below. Which concept(s) are you most unfamiliar with from your prerequisite course?
- Look through the test cases in
WalletDriver.java
. Think of at least one additional test case that we could add to more thoroughly test our implementation ofWallet.java
.
You are not required to write the code to complete this exercise before Wednesday, but you are certainly encouraged to do so.
This exercise is designed to review some of the object-oriented concepts from your introductory programming course. If you have trouble implementing any of the methods or understanding any concepts in this exercise, your instructors recommend thoroughly reviewing your introductory course materials and asking questions to fill in any gaps. All concepts in this exercise will be critical moving forward in CSCI 1302.
- CSCI 1302 Reference Variable Refresher
- A strong understanding of Arrays, Classes, and Objects in the Java programming language.
- In your IDE of choice, create a project called
cs1302-ce00
. - Download Money.java
- Download Wallet.java
- Download WalletDriver.java
- Place
Money.java
,Wallet.java
, andWalletDriver.java
in thesrc
folder of yourcs1302-ce00
project folder.
-
You might find the following introductory video helpful for getting started with the exercise. Please note that this video was created with an older version of this assignment. However, all of the concepts are still relevant.
- Navigate to API Documentation.
- The
Money.java
class is fully implemented for you. Read through the API documentation on the API documentation website to understand the available methods and how to use them. - Your main job for this exercise is to implement
Wallet.java
. There are four unimplemented methods. However, the signatures are provided for you. The comments in the API documentation contain detailed guidelines that you should follow for implementation. You should read all of the comments before writing any code. - Once you have implemented the methods, execute the
WalletDriver.java
class which contains a series of unit tests to thoroughly test your implementation. If you do not pass a test, then inspect the test to see what it's doing, and then try to fix your code.
Copyright © Michael E. Cotterell, Bradley J. Barnes, and the University of Georgia. This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License to students and the public and licensed under a Creative Commons Attribution-NonCommercial 4.0 International License to instructors at institutions of higher education. The content and opinions expressed on this Web page do not necessarily reflect the views of nor are they endorsed by the University of Georgia or the University System of Georgia.