Question: In Java Please Purse Class Assignment Create a class called Purse with the following specifications: The Purse class has three integer attributes ( variables )

In Java Please
Purse Class Assignment
Create a class called Purse with the following specifications:
The Purse class has three integer attributes (variables): the number of quarters
(numQuarters), the number of dimes (numDimes), and the number of nickels
(numNickels).
Create a default constructor that sets the three instance variables to zero
Create another constructor that set the variables to values received as
parameters
Create three accessor methods to return the number of quarters, the
number of dimes and the number of nickels.
Create three modifier methods to change the values of these variables
Create void methods to increase the number of each coin by a certain
amount (addQuarters(int n), addDimes(int n), and addNickels(int n))
Create a method getTotal() to calculate the total number of all coins in the
purse
Create a method totalValue() to return the total value of all coins combined
Create a method toString() to display the Purse object
Create a PurseTester class and create 4 Purse objects (p1, p2, p3 and p4) with
information of your choice then perform the following:
Add 5 quarters, 15 dimes and 8 nickels to Purse object p1.
Add 4 quarters, 20 dimes, and 10 nickels to Purse object p2.
Print all the four Purse objects
Create a Purse array and add the Purse objects to the array
Create a static method that returns the highest number of coins in a purse.
Create a static method that returns the highest total value in a purse.
Create a static method that returns the purse with the highest number of
quarters.
Create a static method that returns the total number of coins in all purses
combined
Create a static method that returns the total value of all coins combined
Call the methods in the main method
Print your work and make sure your name and class period are on top of
the program as a comment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!