In this project, you will write a program that utilizes your knowledge of inheri
ID: 3668213 • Letter: I
Question
In this project, you will write a program that utilizes your knowledge of inheritance in Java. To start, consider a company (“Fuzzy Logic Radio”) that has a number of radio stations. In order to track royalty payments (for songs) and to track Ad plays (so they can charge their advertisers, they want to add logging capabilities that capture each time a song or ad is played. .
AirtimeLog
SongLog AdLog
You need to write classes that contain information about these log entries, and provide methods to set and get appropriate information. For instance, for song’s you need to capture at least the following:
SongID – A string that contains a unique identifier for a Song. Note, for this assignment you don’t need to know or care about the string particulars, just that it is a String.
SongName – A String that contains the song name.
ArtistID – A String that contains a unique identifier of the Artist. Note, for this
assignment you don’t need to know or care about what makes the ArtistID unique,
and can write your test program using a name of the artist as the ArtistID.
DateTime – You also need to capture the current time information. There are a variety of ways to do this. Your method in the class can generate a timestamp,
e.g.
setTime() where the setTime() method generates a timestamp of some sort,
or you can pass a String to your setTime(), e.g. setTime(String timestamp) and put the onus on your calling program to pass the Date/Time as a String.
Note that there are a variety of facilities to manage dates. Java has classes such as Date, Calendar, TimeStamp, SimpleDateFormat. My expectation is that you research these a bit to decide what to use in your program. For this program, I won’t take points off, regardless of what you use...as long as it actually works and you capture the current date and time (down to at least one second granularity).
For the AdLog, you need capture at least the following:
AdvertisementID – (String) A unique identifier of the advertisement.
AdvertiserID – (Stirng) A unique identifier of the advertiser.
DateTime() – Similar to that provided above.
You should use method overriding and overloading as appropriate, and explain in your commentary (and by use of the @override annotation construct).
You should also decide and explain whether you will be using any Abstract classes and methods.
You should have appropriate toString() methods that will produce a string that nicely formats the object with labels for each field in the object.
Your driver program (to test your classes) should do the following:
Generate at least three objects of each type (SongLog, AdLog)
Demonstrate the use of toString() on each of the objects
In addition to the program, create a UML diagram for each of the classes. Upload
this as a pdf.
Create a JING webcast with the following:
o Showing the comments in your code that include your name, the class, and what the assignment is
o Show’s all of your code. Slowly scroll through your code.
o Show your code compiling. Note that with this assignment you will have
multiple source files.
o Show your code running and completely test your program. o Anything special you want me to see? Show it!
Bonus points:
a) 1 bonus point for programs that work with comments submitted by 2/12/2016
(early bird bonus).
b) 1 bonus point if you show the use of instanceOf in your program. Note: There are
reasons NOT to use instanceOf. Indeed, Scott Meyers wrote in Effective C++: “"Anytime you find yourself writing code of the form "if the object is of type
T1, then do something, but if it's of type T2, then do something else," slap yourself.” What this is saying is that you often can use method overriding instead of instanceOf. However, for this assignment I’m just trying to see if you know how to use it.
Explanation / Answer
Software development will be demonstrated in lectures . It is expected that you will start the projects early enough so that you can get any help you may need to get the syntax right after getting those error messages from the Java compiler. Although the programming work can be done on your own computers, and this is encouraged, problems (hardware, software, network access) with your system will not be accepted as excuses for late or missing programming project or lab completion work. Information Commons computers are provided in the UA Libraries as the last resort" for students with computer or network problems. HOWEVER, delays will be granted in case of weather problems or problems with the Blackboard or Information Commons UAlbany infrastructure. Programming guidelines and submission information will appear in separate documents. THIS IS REQUIRED: All programming projects will be submitted as a JING webcast. Please read the JING document in the menu of the class. There is a link to a YouTube video in the document that walks you through instillation and doing screen captures. The only difference in the video is that you submit a link in blackboard to your webcast you do not email it to me. Items your JING webcast should contain: 1) You should start by showing the comments in your code that include your name, the class, and what the assignment is. 2) You should show all of your code. Slowly scroll through your code. 3) You must show your code compiling. 4) You must show your code running and completely test your program. If there are special inputs or outputs your program should check, please make sure you detail that your program can handle it. 5) If there is anything special you added to the program then please detail it. You only have 5 minutes in your screen cast so please make sure you are concise and you cover everything you need. You may have to practice your screen capturing a few times to get this right .
import lata mageskar import spotipy import sys ''' get a set of images for artists that are similar to the given seed artist ''' en = pyen.Pyen() sp = spotipy.Spotify() spids = [] response = en.get('artist/similar', name='weezer', bucket='id:spotify', limit=True) for artist in response['artists']: spids.append(artist['foreign_ids'][0]['foreign_id']) for artist in sp.artists(spids)['artists']: print artist['images'][0]['url'], artist['name']Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.