Homework 3 - BuzzCard Class

Introduction

In this homework, you will practice:

Problem Description

You are hungry after taking an infamous CS1331 exam, so you decide to go get food from the many dining options on campus. Unfortunately, the point of sales service goes down. Luckily, you are a great Java programmer and can make one for the school!

Solution Description

Download hw3.zip and complete the Student and BuzzCard classes that implements the point of sales systems for the three restaurants provided: Subway, Brittain, and Burdells. We have included the skeletons for both classes. The implementation guide can be found below

Do not modify the code we give you.

BuzzCard.java

This class has the following private fields, and associated getter and setter methods for them:

Make sure to make the three instance fields private so that only your methods within the class has access to them!

This class has the following constructors:

One that takes in an int for the Meal Swipes, a double for the Dining Dollars, and a double for the BuzzFunds (in that order) and sets their corresponding instance fields.

This class has the following public methods:

"Buzzcard balance with Dining Dollars: (diningDollars), BuzzFunds: (buzzFunds), Meal Swipes: (mealSwipes)"

Student.java

This class has the following private fields, and associated getter methods for them:

This class has the following public methods:

"Student named (name) with ID: (id)" + BuzzCard info from the BuzzCard toString().

This class has the following constructors:

One that takes in an a BuzzCard object and stores it in card, a String and stores it in name, and an int and stores it in id.

Grading

Running and Testing

Creating a Driver class with a main method to create a simulation to test of all the methods would be the best course of action.

Tips and Considerations

If anything seems confusing, read through the entire description and instructions again. As always, feel free to contact your TAs, post on Piazza, or come in for office hours. In addition, here are some tips specific to this homework:

Javadocs

Starting from this homework, you will need to write Javadoc comments and watch for checkstyle errors with your submission.

See the CS 1331 Style Guide for details.

Checkstyle

For each of your homwork assignments we will run checkstyle and deduct one point for every checkstyle error.

For this homework the checkstyle cap is 20, meaning you can lose up to 20 points on this assignment due to style errors. This limit will increase with each homework.

Collaboration

When completing homeworks for CS1331 you may talk with other students about:

_ What general strategies or algorithms you used to solve problems in the homeworks _ Parts of the homework specification you are unsure of and need more explanation _ Online resources that helped you find a solution _ Key course concepts and Java language features used in your solution _ You may not discuss, show, or share by other means the specifics of your code, including screenshots, file sharing, or showing someone else the code on your computer, or use code shared by others.

Examples of approved/disapproved collaboration:

OKAY: “Hey, I’m really confused on how we are supposed to implement this part of the homework. What strategies/resources did you use to solve it?”

BY NO MEANS OKAY: “Hey… the homework is due in like 20 minutes… Can I see your code? I promise won’t copy it directly!”

In addition to the above rules, note that it is not allowed to upload your code to any sort of public repository. This could be considered an Honor Code violation, even if it is after the homework is due.

Submission