Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this LONG problem.It's Urgent. Can someone help me? THANKS!! Problem 2 Your friend has a music shop and needs you to

I need help with this LONG problem.It's Urgent. Can someone help me?

THANKS!!

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Problem 2 Your friend has a music shop and needs you to develop a software to manage it. He sells music records in two forms, on Vinyl and on CDs. Since both have common characteristics, you decide to design it as follows: a MusicRecord class, from which two other classes Vinyl and CD inherit their properties. Each MusicRecord has a title and artist in the form of a String, and a duration in minutes in the form of an int. Also, each music record should have a method to calculate its price calculatePrice() that returns a double value. However, the prices of a vinyl and a CD are calculated differently, so the method will be abstract in the MusicRecord class. The method will be implemented in each subclass as follows: Vinyl price: diameter x speed x duratiton . CD price:- duration 10 Each class should contain getters and setters, and a toString() method. MusicRecord - title: String - artist: String - duration: int + MusicRecord () +MusicRecord (title:String, artist:String duration: int) +calculatePrice ):double + toString) : String //Getters and Setters Vinyl CD - rewritable: boolean diameter: int speed: int + Vinyl() +Vinyl(title:String, artist:String, duration:int, diameter:int, speed:int) CDO +CD(title:String, artist:String, duration:int, rewritable:boolean) calculatePrice(): double +toString(): String //Getters and Setters calculatePrice(): double + toString(): String //Getters and Setters MusicShop name String records: ArrayList MusicRecord> location: String +MusicShop +MusicShop(records:ArrayList

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

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

Identify the activities associated with each phase.

Answered: 1 week ago