While it’s possible to make both 1D and 2D arrays of objects (and more), for this assignment we’ll start you out with just one dimensional arrays. Your parents have asked you to develop a program to help them organize the collection of rare CDs they currently have sitting in their car’s glove box. To do this, you will first create an AudioCD class. It should have the following private attributes. String cdTitle String[4] artists int releaseYear String genre float condition Your class should also have the following methods: Default Constructor: Initializes the five attributes to the following default values: ◦ cdTitle = “” ◦ artists = {“”, “”, “”, “”} ◦ releaseYear = 1980 ◦ genre = “” ◦ condition = 0.0 Overloaded Constructor: Initializes the five attributes based on values passed into the formal parameters ◦ If condition is less than 0.0 or greater than 5.0, set it equal to 0.0 ◦ If releaseYear is less than 1980, set it equal to 1980 ◦ Print message if the parameter’s artist array size is greater than 4, and only store the first four values Getter method for all class attributes You will then create a separate class, Assignment7A. In its main method, you should do the following: Ask the user how many Audio CDs are in their collection Create an array (of type AudioCD) of that size Use a loop to ask the user to enter information for all CDs ◦ Create a AudioCD object for each Audio CD and store it in the next index in the array Then using another loop, you should give the user the following options: Print Audio CD information ◦ This should ask the user for a number, and then print the information from the AudioCD object at that index using a custom toString() method. If the index is out of bounds, it should notify the user instead. Search for an Audio CD from the collection ◦ This should ask the user for an Audio CD name, then search the array for an Audio CD with that name (case insensitive). If it exists in the array, then it should print the same information about the Audio CD as in the prior point (Hint: Could you make a method to simplify this process?). If it does not exist in the array, notify the user. Search for an artist from the collection ◦ This should ask the user for an artist name, then search the array for an Audio CD by that artist (case insensitive). Print all the Audio CDs that the artist worked on in the collection. If they are not in the array, notify the user. Quit ◦ Ends the loop and the program Sample Output: [Rate Audio CD Collection] How many CDs do you have lying around your car? 8 CD #1: *Enter Title: Back to the Future: Music from the Motion Picture Soundtrack *Enter Artists (type -1 when finished): Huey Lewis and the News Lindsey Buckingham Alan Silvestri Chuck Berry -1 *Enter Genre: Pop Rock *Enter Release Year: 1985 *Enter Condition: 4.8 CD #2: *Enter Title: Batman (Soundtrack) *Enter Artists (type -1 when finished): Prince Sheena Easton Eric Leeds and the Atlanta Bliss -1 *Enter Genre: Rock, Funk, Pop *Enter Release Year: 1989 *Enter Condition: 2.4 //Keep going for all 8 CDs (THIS IS NOT PART OF THE OUTPUT) [Main Menu] 1) Album Info 2) Find a CD 3) Find an artist 4) Log off Choice: 1 Which CD do you want? 100 Sorry, there’s no CD that matches the criteria. [Main Menu] 1) Album Info 2) Find a CD 3) Find an artist 4) Log off Choice: 1 Which CD do you want? 1 1. Batman (Soundtrack), 1989 Artist (#1): Prince Artist (#2): Sheena Easton Artist (#3): Eric Leeds and the Atlanta Bliss Genre: Rock, Funk Pop Condition: 2.4 [Main Menu] 1) Album Info 2) Find a CD 3) Find an artist 4) Log off Choice: 2 What is the CD’s name? Batman There is a match! 1. Batman (Soundtrack), 1989 Artist (#1): Prince Artist (#2): Sheena Easton Artist (#3): Eric Leeds and the Atlanta Bliss Genre: Rock, Funk Pop Condition: 2.4 [Main Menu] 1) Album Info 2) Find a CD 3) Find an artist 4) Log off Choice: 3 What artist are you looking for? Chuck Berry 2 CD(s) found! CD: Back to the Future: Music from the Motion Picture Soundtrack CD: Johnny B. Goode [Main Menu] 1) Album Info 2) Find a CD 3) Find an artist 4) Log off Choice: 4 Goodbye! Assignment 7B: Battle! For our last assignment in CSE 1321L, we’re going to recreate a basic battle system from a video game. You will create a character and then use it to battle a computer generated opponent. There are three possible classes, with the following attributes: You will create a NPC class that has these three attribute. It should also have an attribute for Name. You will then create the following methods in the NPC class: A constructor that takes in a Name string and a ClassID int. It should use the value of the ClassID to assign values to the other attributes (using the chart above) Getter methods for all five attributes, and a Setter method for HP that subtracts the object’s HP by the value passed in. calculateAttack ◦ This method returns a float value. It takes in a float that represents the opponent’s defense percentage. It should multiply the object’s attack by the Sword Fighter Unicorn Sorcerer Dance Battler HP: 120 Attack: 40 Defense: 0.20 ClassID: 1 HP: 80 Attack: 35 Defense: 0.60 ClassID: 2 HP: 100 Attack: 20 Defense: 0.42 ClassID: 3 inverse of the opponent’s defense percentage, and return that value. For example: 100 * (1 – 0.60) = 40 calculateDefense ◦ This method returns nothing. It takes in a float that represents the opponent’s attack power. It should multiply the opponent’s attack by the inverse of the object’s defense percentage, then subtract 6 additional points from the result. This value should then be subtracted from the object’s HP. isStillAlive ◦ This method returns a boolean value. It should check if the object’s HP is less than or equal to 0. If it is, then return FALSE. Otherwise, return TRUE. You may add other “helper” methods to reduce redundant code, although this is not required. You should then create a driver class, Assignment7B. This program should do the following: Prompt the user for a custom name and what class they want their character to be. You should use this information to create an NPC object. Randomly generate another NPC object to represent the opponent. You can do this by randomly generating the two primitive values, then using them to construct the opponent NPC. Create a loop that runs until one of the opponents runs out of HP. You will first prompt the player to either attack or defend. Then, you will have the opponent randomly choose to either attack or defend. ◦ If both the human and computer player choose to defend, do nothing. ◦ If both of them attack, then call the calculateAttack function on both objects. ◦ If one attacks and one defends, call the calculateDefense function on the defending object. After both choices are made, display messages indicating the actions take and the remaining HP for both sides. When one or both players are defeated, stop the loop and print the results. Sample Output: [Generic RPG Battle System] Enter your name: Morgan Enter your battle class: Unicorn Sorcerer Morgan the Unicorn Sorcerer, your opponent is Brad the Battle Dancer! -Round 1- Do you (a)ttack or (d)efend? a Morgan the Unicorn Sorcerer attacked Brad the Battle Dancer! Brad now has 79.7 HP. Brad the Battle Dancer attacked Morgan the Unicorn Sorcerer! Morgan now has 72 HP. -Round 2- Do you (a)ttack or (d)efend? d Morgan the Unicorn Sorcerer is on guard. Brad the Battle Dancer is on guard. -Round 3- Do you (a)ttack or (d)efend? d Morgan the Unicorn Sorcerer is on guard. Brad the Battle Dancer attacked Morgan the Unicorn Sorcerer! Morgan now has 70 HP. //Skipping ahead to the end of this epic battle (THIS IS NOT PART OF //THE OUTPUT Brad the Battle Dancer was defeated… Morgan the Unicorn Sorcerer wins!