You will design and implement your own data class. The class will store data that has been read as user input from the keyboard (see Getting Input below), and provide necessary operations. As the data stored relates to monetary change, the class should be named Change. The class requires at least 2 instance variables for the name of a person and the coin change amount to be given to that person. You may also wish to use 4 instance variables to represent amounts for each of the 4 coin denominations (see Client Class below). There should be no need for more than these instance variables. However, if you wish to use more instance variables, you must provide legitimate justification for their usage in the internal and external documentation. Your class will need to have at least a default constructor, and a constructor with two parameters: one parameter being a name and the other a coin amount. Your class should also provide appropriate get and set methods for client usage. Other methods may be provided as needed. However, make sure they are necessary for good class design; you must provide legitimate justification for their usage in the internal and external documentation. In particular, your class should NOT include Input and Output methods. The only way to get data out of a data class object to the client program is to use an appropriate get method. The data class methods must not write data out. Data should be entered into a data class object via a constructor or an appropriate set method. When designing your Change class, use an UML class diagram to help understand what the class design needs. Getting Input: Input for the client program will come from keyboard (entered by the user). The input should consist of: the name of a person, and a coin value (as an integer). The program should validate the input coin value to ensure that it is in the range 5 to 95, and is evenly divisible by 5. Names are one-word strings. You should ask the user to enter the required information using a loop with a question after each loop iteration to check if the user wants to end the input of data. It is recommended for the user to input at least 9 such data – this can be conveyed to the user using a message before entering the loop. NOTE: for the purpose of testing the program by your tutor, you should provide a method in the client class that hardcodes data into at least 10 Change objects and stores these objects into the array provided by your program. In this case, your tutor would not need to manually key in the data to test the program when assessing your work. Thus, you should provide a call to this method (commented out) in the main function; this can be uncommented by your tutor as needed. Page 3 of 9 Example of inputs as follows: Recommendation: Please enter at least 10 records to test the program. Please enter the name of the person: Jane Please enter the coin value for the person (range 5 to 95, multiple of 5): 30 Do you have more person to enter (Y/N): Y Please enter the name of the person: John Please enter the coin value for the person (range 5 to 95, multiple of 5): 50 Do you have more person to enter (Y/N): Y Please enter the name of the person: Fred Please enter the coin value for the person (range 5 to 95, multiple of 5): 94 Incorrect coin value. Must be in the range 5 to 95, and multiple of 5. Please enter the name of the person: Wilma Please enter the coin value for the person (range 5 to 95, multiple of 5): 100 Incorrect coin value. Must be in the range 5 to 95, and multiple of 5. Please enter the name of the person: Jane Please enter the coin value for the person (range 5 to 95, multiple of 5): 35 Do you have more person to enter (Y/N): Y … (assuming this is repeated at least 10 times) Do you have more person to enter (Y/N): N … (go out of the loop) Page 4 of 9 Client Class: The client program should read the input data from the user (or the method with hardcoded inputs) and use the Change class to store the data entered. This data should be stored in a Change class object. You will need a data structure to store the Change class objects according to the number of persons entered. Thus, you are to utilize an array of Change objects. Do not use ArrayList for this assignment. It should be noted that it is possible to have the same name entered numerous times, but the coin values for such repetitions could be different. When the name is the same, it would mean the same individual, and your program should add up the coin amounts to obtain a total amount for that individual; this should be performed before computing the change to be given.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 1CP: In previous chapters, you have created programs for the Greenville Idol competition. Now create a...
icon
Related questions
Question
100%

User-defined Class:
You will design and implement your own data class. The class will store data that has been read as
user input from the keyboard (see Getting Input below), and provide necessary operations. As the
data stored relates to monetary change, the class should be named Change. The class requires at
least 2 instance variables for the name of a person and the coin change amount to be given to that
person. You may also wish to use 4 instance variables to represent amounts for each of the 4 coin
denominations (see Client Class below). There should be no need for more than these instance
variables. However, if you wish to use more instance variables, you must provide legitimate
justification for their usage in the internal and external documentation.
Your class will need to have at least a default constructor, and a constructor with two parameters:
one parameter being a name and the other a coin amount. Your class should also provide appropriate
get and set methods for client usage. Other methods may be provided as needed. However, make
sure they are necessary for good class design; you must provide legitimate justification for their
usage in the internal and external documentation. In particular, your class should NOT include Input
and Output methods. The only way to get data out of a data class object to the client program is to
use an appropriate get method. The data class methods must not write data out. Data should be
entered into a data class object via a constructor or an appropriate set method.
When designing your Change class, use an UML class diagram to help understand what the class
design needs.
Getting Input:
Input for the client program will come from keyboard (entered by the user). The input should consist
of: the name of a person, and a coin value (as an integer). The program should validate the input
coin value to ensure that it is in the range 5 to 95, and is evenly divisible by 5. Names are one-word
strings. You should ask the user to enter the required information using a loop with a question after
each loop iteration to check if the user wants to end the input of data. It is recommended for the user
to input at least 9 such data – this can be conveyed to the user using a message before entering the
loop.
NOTE: for the purpose of testing the program by your tutor, you should provide a method in the
client class that hardcodes data into at least 10 Change objects and stores these objects into the array
provided by your program. In this case, your tutor would not need to manually key in the data to
test the program when assessing your work. Thus, you should provide a call to this method
(commented out) in the main function; this can be uncommented by your tutor as needed.
Page 3 of 9
Example of inputs as follows:
Recommendation: Please enter at least 10 records to test the program.
Please enter the name of the person:
Jane
Please enter the coin value for the person (range 5 to 95, multiple of 5):
30
Do you have more person to enter (Y/N):
Y
Please enter the name of the person:
John
Please enter the coin value for the person (range 5 to 95, multiple of 5):
50
Do you have more person to enter (Y/N):
Y
Please enter the name of the person:
Fred
Please enter the coin value for the person (range 5 to 95, multiple of 5):
94
Incorrect coin value. Must be in the range 5 to 95, and multiple of 5.
Please enter the name of the person:
Wilma
Please enter the coin value for the person (range 5 to 95, multiple of 5):
100
Incorrect coin value. Must be in the range 5 to 95, and multiple of 5.
Please enter the name of the person:
Jane
Please enter the coin value for the person (range 5 to 95, multiple of 5):
35
Do you have more person to enter (Y/N):
Y
… (assuming this is repeated at least 10 times)
Do you have more person to enter (Y/N):
N
… (go out of the loop)
Page 4 of 9
Client Class:
The client program should read the input data from the user (or the method with hardcoded inputs)
and use the Change class to store the data entered. This data should be stored in a Change class
object. You will need a data structure to store the Change class objects according to the number of
persons entered. Thus, you are to utilize an array of Change objects. Do not use ArrayList for this
assignment.
It should be noted that it is possible to have the same name entered numerous times, but the coin
values for such repetitions could be different. When the name is the same, it would mean the same
individual, and your program should add up the coin amounts to obtain a total amount for that
individual; this should be performed before computing the change to be given.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,