QuestionQuestion

BuzzCard.java
This class has the following private fields, and associated getter and setter methods for them:
• mealSwipes which is an int that represents the number of meal swipes left
• diningDollars which is a double that represents the amount of dining dollars left.
• buzzFunds which is a double that represents the amount of buzzfunds left.
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:
• String toString() which returns the String representations of the student’s in the following format:
"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:
• card which is a BuzzCard object that represents the student’s BuzzCard.
• name which is a String that represents the name of the student.
• id which is an int that represents the gtID of the student.
This class has the following public methods:
• void buyBrittainMealSwipes(BrittainItem item) which will allow the student to buy items from Brittain Dining Hall using meal swipes. If the student does not have the amount needed to buy them item, print to the console "You do not have the amount to buy this item :("
• void buyBrittainBuzzFunds(BrittainItem item) which will allow the student to buy items from Brittain Dining Hall using BuzzFunds. If the student does not have the amount needed to buy them item, print to the console "You do not have the amount to buy this item :("
• void buyBurdellsBuzzFunds(BurdellsItem item) which will allow the student to buy items from Burdells using BuzzFunds. If the student does not have the amount needed to buy them item, print to the console "You do not have the amount to buy this item :("
• void buySubwayDiningDollars(SubwayItem item) which will allow the student to buy items from Subway using dining dollars. If the student does not have the amount needed to buy them item, print to the console "You do not have the amount to buy this item :("
• void buySubwayBuzzFunds(SubwayItem item) which will allow the student to buy items from Subway using BuzzFunds. If the student does not have the amount needed to buy them item, print to the console "You do not have the amount to buy this item :("
• For all of the above methods, decrement the appropriate value on the student’s buzzcard.
• String toString() which returns the String representations of the student’s information in the following format:
"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.
You can assume input will be of the correct type (i.e, we will not break your code by giving you a String instead of an int), but not necessarily the correct values (i.e, if you ask for an int between 1 and 5 we might enter 9). Your code should handle these cases gracefully.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

/**
* Class representing the buzzcard
*/
public class BuzzCard {

    private int mealSwipes;
    private double diningDollars;
    private double buzzFunds;
   
    public BuzzCard(int mealSwipes, double diningDollars, double buzzFunds) {
       this.mealSwipes = mealSwipes;
       this.diningDollars = diningDollars;
       this.buzzFunds = buzzFunds;
    }
   
    public int getMealSwipes() {
       return mealSwipes;
    }
   
    public void setMealSwipes(int mealSwipes) {
       this.mealSwipes = mealSwipes;
    }
   
    public double getDiningDollars() {
       return diningDollars...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$45.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats