Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedanswer 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 Discountable

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago