Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write code please Assignment 4 Media Rental System Before attempting this project, be sure you have completed all the reading assignments, nongraded exercises, examples, discussions,

write code please
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Assignment 4 Media Rental System Before attempting this project, be sure you have completed all the reading assignments, nongraded exercises, examples, discussions, and assignments to date. There is only one java file for all the coding of this assignment allowed. Multiple java files are not acceptable 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, - calculate rental fee (\$1.50 flat fee for all transactions) change title 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 0 . - 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 0 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. MediaID - 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 0 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 0 method. - The switch should not be considered process coding - no conditionals - but calls to methods in the program. 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: 27631,false,E,TheHigherTheyFall,2012,15,3.0087324,false,C,DinnerSounds,1995,62,4.2983924,false,D,TheFuriousCrew,2019,1,4.7598342,false,E,NeverMindtheClutter,2018,45,7.0037261,false,C,WakeUpTeam,2020,103,8.1418725,false,D,HolidayScene,2021,1,9.75 Media Array Fields: The following are the fields in the Media Arraylist. 1. MedialD - exactly five integers 2. RentStatus - Boolean - true for rented; false for not rented [Can use the integer 0 for not rented or the integer 1 for rented.] 3. MediaModel - character - E for Ebook; C for CD; D for DVD 4. Title - string - Appropriate combination of characters and numbers 5. YearPublished - string [Since there is no calculation involved, the string data type is preferable.] 6. ScopeMedia - integer - the measure used for the MediaModel calculation: EBook: number of chapters; CD: number of minutest DVD: 1 as default. 7. CalculatedFee - double - the rental fee applicable to the specific MediaModel. The calculations: Model EBook object which is a child of Media and is calculated. - The rental fee for EBook is the number of chapters .10+$1.50 [ftat fee] - If EBook was published after year 2015 add $1.00. Model MusicCD object which is a child of Media and is calculated. - 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. Model MovieDVD object which is a child of Media and is calculated:i - 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. Examples: 27631 , false, E, The Higher They Fall, 2012, 15, 3.00[1.50+(150.10)] 87324 , false, C, Dinner Sounds, 1995,62,4.29[1.50+(620.045)] 83924 , false, D, The Furious Crew, 2019, 1, 4.75 [1.50+3.25] 98342, false, E, Never Mind the Clutter, 2018, 45, 7.00[1.50+(450.10) +1.00 (after 2015)] 37261, false, C, Wake Up Team, 2020, 103, 8.14 [1.50+(1030.045)+ 2.00 (year after 2014)] 18725, false, D, Holiday Scene, 2021,1,9.75[1.50+3.25+$5.00 (after 2019)] The report below used courier New as the fond it is one of a few that is monospoced, 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: Your result will not look like this but be rassed. It is expected and acceptable. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions