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 addQuartersint n addDimesint n and addNickelsint 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 Purse objects p p p and p with
information of your choice then perform the following:
Add quarters, dimes and nickels to Purse object p
Add quarters, dimes, and nickels to Purse object p
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
