Scenario:

Piano Partners is a business that teaches children how to play the piano. Only children between the ages of 5 and 17, inclusive of these ages, are eligible to be taught. The company has asked you to create an application to track the children it teaches. You decide it would be a good idea to beta test your application on a small scale before releasing it to the company. Because of this, you decide to limit the application to only support 30 children with the realization you might change this number later on.

For each child, the application must store the childs name, age, street address, phone number, and level. A valid phone number is in the format: xxx-xxx-xxxx. An example phone number is: 703-993-3565. A valid level is in the format of two values separated by one dash character. The value to the left of the dash must be a number between 1 and 4 while the value to the right of the dash must only be one of the following characters: A, B, or C. Example levels are: 1-A, 3-C, and 4-B.

Children are registered for a set number of lessons per week. They may register for up to 7 lessons per week, but must register for at least 2. All lessons take place at one of two locations: at the childs home or at a local Piano Partners studio. Lessons cannot be split across locations. That is, all lessons must be either at the childs home or at a local Piano Partners studio. Children are charged a fee of $206 per lesson. An additional $26 surcharge, per lesson, is added if the lessons are completed at a local Piano Partners studio. For example, a child that takes four lessons per week at a local Piano Partners studio will pay $928.

Lastly, there are some children that take part in piano competitions. Your application must have a way to create a competition child. A competition child contains all of the same pieces of data as a regular child does, but in addition, you must also track the total number of trophies earned by the child and a list of the names of competitions the child has competed in. Competition children must also pay a surcharge of $15 per lesson on top of all other costs. For example, a competition child that takes four lessons per week at a local Piano Partners studio will pay $988.

Create an efficient, object-oriented solution with a polished user interface that will allow a user to manage the Piano Partners business. At the start of the application, the user must be presented with a menu containing the following options:

  • Add New Child
  • Print Child Information
  • Find Most Talented Child
  • Quit

The Add New Child option must allow the user to enter a regular child or a competition child and enter in all information about the child, including their level. For a competition child, the user must also be able to enter the number of trophies earned and a list of the names of competitions the child has competed in. However, if the user has already entered 30 children, the user should see a message indicating the beta version of the application only supports 30 children at this time.

The Print Child Information option must list all children, and prompt the user to select one child to be printed. For this child, a well-formatted report should be created, displaying the childs name, age, street address, phone number, level, number of weekly lessons, and total weekly cost. If a competition child is selected, the report must also contain the number of trophies earned and a list of competitions the child has competed in.

The Find Most Talented Child option must search only competition children and print only the name and age of the child that has earned the most trophies. If more than one child is tied for the most trophies, then all children tied must be printed.

Once a user selects any menu option other than Quit, and the option is finished executing, they should be re-prompted to enter another menu option.

Other Requirements:

  • Your solution must demonstrate use of arrays. You may not use ArrayLists.
  • Your solution must demonstrate the concept of inheritance.
  • You may not use Scanner or System classes for input/output. You must use JOptionPane.
  • You may not use System.exit, or any variant that exits the program in the middle of the program. The program should only exit once the algorithm has finished completing.

Programming Assignment 5: Solution Design

  • List and describe the purpose of each class that will be needed to solve this problem
    • You must separately identify (list) and describe the purpose of each class. One or two sentences per class should be sufficient.
  • Create a detailed UML class diagram, listing and explaining all class variables, accessors, mutators, special purpose methods, and constructors associated to each data definition class
  • Create a defining diagram/IPO hierarchy chart detailing the implementation design (Note: You must do this, but it is not required to be submitted
  • Create pseudocode detailing your solution design
    • Data Definition Class(es) You must provide pseudocode ONLY for validating mutators and special purpose methods. No pseudocode is necessary for constructors or accessors
    • Implementation Class You must provide pseudocode for all methods

Programming Assignment 6: Solution Implementation

Write a well-documented, efficient Java program that implements the solution design you identified. Include appropriate documentation as identified in the documentation expectations document.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.