Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can I get help on my final? Design and implement Java program as follows: 1) Model Media object to include at minimum the following: -
Can I get help on my final?
Design and implement Java program as follows: 1) Model Media object to include at minimum the following: - Member variables (attributes): id (exactly 5 number characters), title (string that can be more than one word), year published (integer or String) - Functionality: constructor with all the attribute values, o calculate rental fee ( $1.50 flat fee for all transactions) o change title o change year published - get each attribute value - The class should be declared abstract as it represents a generic media and should not allow a creation of this class directly. - Note that id value cannot be changed after creation. 2) Model EBook object which is a child of Media and includes: - Member variables (attributes): inherits from parent. - An attribute for number of chapters (integer). - Functionality: inherited functionality plus constructor with all the attribute values - Display values to the console. - The rental fee for EBook is the number of chapters 0.10+$1.50 [flat fee] - If EBook was published after year 2015 add $1.00. 3) Model MusicCD object which is a child of Media and includes - Member variables (attributes): inherits from parent. - An attribute for length in minutes (integer). - Functionality: inherited functionality plus constructor with all the attribute values - Display values to the console - The rental fee for MusicCD is the minute length 0.045+$1.50 [flat fee]. - If MusicCD was published after year 2014 add $2.00. 4) Model MovieDVD object which is a child of Media and includes: - Member variables (attributes): inherits from parent. - An attribute for size in megabytes (integer). - Functionality: inherited functionality plus constructor with all the attribute values. - Display values to the console - The rental fee for MovieDVD is the fee $3.25+$1.50 [flat fee]. - For the after year 2019, the flat fee is $5.00. 5) Design and implement Manager class which: - Stores a list of Media objects in the ArrayList created in the main (). - Functionality to (1) Add, (2) Find, (3) Remove, (4) Rent, (5) Modify, (6) Display One Media Object, (7) Display All Media of one Type, and (8) Display Whole Library of Media Objects. Menu should include (9) Exit. 6) Create main () method which does the following: - Creates an instance of the Media Manager. - Create and ArrayList to hold the media library. - Declares and defines an array that contains the following fields: 1. MedialD - string - five number characters [No calculation so no need for integer. User enters the digits. Check for exactly five number characters.] 2. RentStatus - Boolean - true for rented; false for not rented [Can use the integer 0 for not rented or the integer 1 for rented thus an Integer.] 3. MediaModel - character - E for Ebook; C for CD; D for DVD 4. Title - string - Appropriate combination of characters and numbers accepting more than one word. 5. YearPublished - string - 4 digits [Since there is no calculation involved, the string data type is preferable.] 6. ScopeMedia - integer - the measure used for the Media Model calculation: EBook: number of chapters; CD: number of minutes; DVD: 1 as default. 7. Calculated fee - double - the rental fee applicable to the specific Media Model type. - Generate a menu for the various major functions: Add, Find, Remove, Rent, Modify, and Display one or Display all members of a category or Display the library using switch appropriately. - The Find, Remove, Modify, Rent, and Display selections use the five number character for searching. [The Find and Display one element are equivalent in coding.] - All additions and removals are from the Media ArrayList with appropriate confirmation or error message for the action. - Display each instance's attribute data as well as the rental fee by calling calculate method. - Change EBook instance's number of chapters or year published and display new rental fee in the Modify selection. - Change MusicCD instance's length or year published and display new rental fee in the Modify selection. - Change MusicCD instance's year published and display new rental fee in the Modify selection. - When user requests to close the program, the program displays all the data in the modified Media ArrayList. - The main O should be considered as a driver, that is, only the minimum number of code lines are in it. - Most of the coding is done in methods that are outside of the main () method. - The switch should not be considered process coding - no conditionals - but calls to methods in the program. 7) Make sure you implement correct encapsulation (private attributes when value can change). 8) To get current year you can use: Calendar.getInstance( ( get (Calendar.YEAR). 9) Program should throw and catch Java built-in and user-defined exceptions as appropriate, 10) Your classes must be coded with correct encapsulation: private/protected attributes and value validation, 11) There should be appropriate polymorphism: overloading, overriding methods, and dynamic binding, 12) Program should take advantage of the inheritance properties as appropriate, Display Example: The report below uses Courier New as the font. It is one of a few fonts that is monospaced, that is, each letter takes up the same amount of space on the horizontal plain of the display. Most fonts are proportional and therefore each of the letters takes up a different amount of space on the line. Point: This font generates a clean and justified result in the columns. Your result will not look like this but be ragged. It is expected and acceptable when the report is reviewed and graded. Do not try to make all columns justified, you will go crazy. Excel Alternative: Design and implement Java program as follows: 1) Model Media object to include at minimum the following: - Member variables (attributes): id (exactly 5 number characters), title (string that can be more than one word), year published (integer or String) - Functionality: constructor with all the attribute values, o calculate rental fee ( $1.50 flat fee for all transactions) o change title o change year published - get each attribute value - The class should be declared abstract as it represents a generic media and should not allow a creation of this class directly. - Note that id value cannot be changed after creation. 2) Model EBook object which is a child of Media and includes: - Member variables (attributes): inherits from parent. - An attribute for number of chapters (integer). - Functionality: inherited functionality plus constructor with all the attribute values - Display values to the console. - The rental fee for EBook is the number of chapters 0.10+$1.50 [flat fee] - If EBook was published after year 2015 add $1.00. 3) Model MusicCD object which is a child of Media and includes - Member variables (attributes): inherits from parent. - An attribute for length in minutes (integer). - Functionality: inherited functionality plus constructor with all the attribute values - Display values to the console - The rental fee for MusicCD is the minute length 0.045+$1.50 [flat fee]. - If MusicCD was published after year 2014 add $2.00. 4) Model MovieDVD object which is a child of Media and includes: - Member variables (attributes): inherits from parent. - An attribute for size in megabytes (integer). - Functionality: inherited functionality plus constructor with all the attribute values. - Display values to the console - The rental fee for MovieDVD is the fee $3.25+$1.50 [flat fee]. - For the after year 2019, the flat fee is $5.00. 5) Design and implement Manager class which: - Stores a list of Media objects in the ArrayList created in the main (). - Functionality to (1) Add, (2) Find, (3) Remove, (4) Rent, (5) Modify, (6) Display One Media Object, (7) Display All Media of one Type, and (8) Display Whole Library of Media Objects. Menu should include (9) Exit. 6) Create main () method which does the following: - Creates an instance of the Media Manager. - Create and ArrayList to hold the media library. - Declares and defines an array that contains the following fields: 1. MedialD - string - five number characters [No calculation so no need for integer. User enters the digits. Check for exactly five number characters.] 2. RentStatus - Boolean - true for rented; false for not rented [Can use the integer 0 for not rented or the integer 1 for rented thus an Integer.] 3. MediaModel - character - E for Ebook; C for CD; D for DVD 4. Title - string - Appropriate combination of characters and numbers accepting more than one word. 5. YearPublished - string - 4 digits [Since there is no calculation involved, the string data type is preferable.] 6. ScopeMedia - integer - the measure used for the Media Model calculation: EBook: number of chapters; CD: number of minutes; DVD: 1 as default. 7. Calculated fee - double - the rental fee applicable to the specific Media Model type. - Generate a menu for the various major functions: Add, Find, Remove, Rent, Modify, and Display one or Display all members of a category or Display the library using switch appropriately. - The Find, Remove, Modify, Rent, and Display selections use the five number character for searching. [The Find and Display one element are equivalent in coding.] - All additions and removals are from the Media ArrayList with appropriate confirmation or error message for the action. - Display each instance's attribute data as well as the rental fee by calling calculate method. - Change EBook instance's number of chapters or year published and display new rental fee in the Modify selection. - Change MusicCD instance's length or year published and display new rental fee in the Modify selection. - Change MusicCD instance's year published and display new rental fee in the Modify selection. - When user requests to close the program, the program displays all the data in the modified Media ArrayList. - The main O should be considered as a driver, that is, only the minimum number of code lines are in it. - Most of the coding is done in methods that are outside of the main () method. - The switch should not be considered process coding - no conditionals - but calls to methods in the program. 7) Make sure you implement correct encapsulation (private attributes when value can change). 8) To get current year you can use: Calendar.getInstance( ( get (Calendar.YEAR). 9) Program should throw and catch Java built-in and user-defined exceptions as appropriate, 10) Your classes must be coded with correct encapsulation: private/protected attributes and value validation, 11) There should be appropriate polymorphism: overloading, overriding methods, and dynamic binding, 12) Program should take advantage of the inheritance properties as appropriate, Display Example: The report below uses Courier New as the font. It is one of a few fonts that is monospaced, that is, each letter takes up the same amount of space on the horizontal plain of the display. Most fonts are proportional and therefore each of the letters takes up a different amount of space on the line. Point: This font generates a clean and justified result in the columns. Your result will not look like this but be ragged. It is expected and acceptable when the report is reviewed and graded. Do not try to make all columns justified, you will go crazy. Excel Alternative
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started