Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me do this assignment! Thank you! Part 2 The questions in this part of the assignment will be graded. Question 1: Twitter (100

Please help me do this assignment! Thank you!

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

Part 2 The questions in this part of the assignment will be graded. Question 1: Twitter (100 points) For this question, you will write two classes to create a new data type that will model information extracted from twitter. Your code for this question will go in two .java files We strongly recommend that you complete all the warm-up questions before starting this problem. Note that in addition to the required methods below, you are free to add as many other private methods as you want (a) Tweet Class Tweet.java stores information and behaviours about a tweet. A tweet is a message sent using the social network Twitter. For this assignment, the tweets are defined as messages from 1 to 15 words (after ommiting stop words). The Tweet class stores information about a tweet: the user who tweeted it, the date of the tweet, the time of the tweet, and the actual tweet message The Tweet class should contain the following private attributes A String userAccount; This attribute stores the user id A String date; A String time; A String message; This attribute stores the date on which the tweet was tweeted This attribute stores the time on which the tweet was tweeted This attribute stores the tweeted message The Tweet class should also contain a private static attribute An HashSet stopwords This attribute stores the set of stop-words. A stop word is a commonly used word that is ignored by search engines2 Regarding the behaviour of the class, Tweet must implement the following methods A constructor that takes as inputs four Strings. The Strings correspond to: i) the user account ii) the date on which the tweet was posted. The format of the date is YYYY-MM-DI iii) the time on which the tweet was posted. The format of time is HH:MM:SS and iv) the message of the tweet. Please notice that your arguments must respect the previous order. The constructor does not have to check the format of the inputs A private static checkMessage method which takes as input a String indicating the tweet message. This method will check if the String received as a parameter represents a valid message or not. This method must return true if the length of the message is less than or equal to 15 words and greater than or equal to 1 word (excluding the stopWords). If the HashSet stopWords is equal to null, checkMessage must thrown a NullPointerException indicating that the HashSet has not been initialized Here a couple of hints

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 Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago