Answered step by step
Verified Expert Solution
Question
1 Approved Answer
answer quickly.urgent please Question 1 [40 pts] Implement the below classes and interface as presented in the following UML diagram except the class BasicSubscriber for
answer quickly.urgent please
Question 1 [40 pts] Implement the below classes and interface as presented in the following UML diagram except the class BasicSubscriber for which you will find the code provided below. For all classes implement only the getters that you will need later in your code. SpotifyPage title: String - nbOfSubscribers: int Subscriber - subscribers: Subscriber[] #id: int SpotifyPage (title:String, maxNbOfSub:int) # name: String addSubscriber(s: Subscriber): void #monthlyFees: double + subscriberById(id:int): subscriber + Subscriber (id: int, name: String) + nbOfPremiumSubscribers(): int + toString(): String + totalMonthly Income(): double > Discountable + feesAfter Discount(): double Basic Subscriber PremiumSubscriber - joinDate: String - premium Years: int + Constructor (--All Parameters--) + Constructor (--All Parameters--) + toString(): String + toString(): String A. [6 pts) Write the abstract class Subscriber as presented in the above UML. a) Write the constructor that takes as parameters all data fields. b) Assuming a subscriber has an id of 12345, name of John White, and monthly fees of 50, the toString method should return a String in the following format: ID: 12345, Name: John White, Monthly Fees: $50.0 B. [4 pts] Write the interface DiscountableStep 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