Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
Question
Use java code to complete. Please zoom in if difficult to read.
Transcribed Image Text:Program 1:
1. Create a class mimicking some of the features of Netflix. You may name it class Netflix.
2. Add the following class variables to it, for example:
a. String array which holds say any 10 Netflix series/movies (fill the array in the
constructor).
b. String array which holds 5 "Continue Watching" items (fill the array in the
constructor).
c. String array which holds Top 5 "Trending" items(fill the array using no-argument or
parameterized constructor).
d. String username
e. String password
f. boolean isAuthenticated. This should be a 'private' class variable.
g. double balance remaining for the user
h. int subscriber since, like subscriber since 2015
3. Add the following class methods to it:
a. A method that asks for the username and password of the user.
Note: Because we do not have any database, just assume all username/password
combinations are valid, so set the isAuthenticated variable to true and print a login
successful message inside this method with the value of isAuthenticated variable.
b. A method that prints Top 5 Trending items in ascending order.
(Use Arrays.sort() library method to quickly sort arrays).
c. A method that prints logged in username, remaining balance and subscriber since
information.
d. A method (like updateContinueWatching(String strValue) which takes a String
parameter and updates the Continue Watching array for the user. So in NetflixDemo
class, take a movie or TV show name as input from the user and pass it to this
updateContinueWatching(value) method. Print the final Continue Watching array.
Note: New value should take first position in the Continue Watching array (index 0).
For example: Say your current Continue Watching array is:
["Ozark", "Narcos", "Schitts Creek", "The Crown", "Better Call Saul"]
And you are now adding "Breaking Bad", then the updated Continue Watching array
should look like this:
["Breaking Bad", "Ozark", "Narcos", "Schitts Creek", "The Crown"]
So, move all items to the right by 1 (and we lose the last item) and put the new value
at index 0.
4. Create another class called NetflixDemo.
a. Create two objects "user1" and "user2" of the Netflix class.
b. Set various class variables for the Netflix class using these two objects.
c. Call various methods of Netflix class using these two objects.
Notes:
1. Use try-catch block to handle any exception that might occur due to user input.
2. Write Javadoc at the top of the classes with author name and brief description of the class.
3. Please submit the java program files and screenshot of the output.
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
Step by stepSolved in 4 steps with 6 images
Knowledge Booster
Background pattern image
Similar questions
- Write the Java statement to create an instance of a Rectangle with a width of 4 and a length of 8. Edit View Insert Format Tools Tablearrow_forwardInclude a formula in the last column on the third row to calculate 75% of the Cost. The formula is =0.75*b3. You do not need to select a number format. Include a formula in the next two rows of the same column, adjusting the row reference as necessary.arrow_forwardHow long does the mouse pointer remain on a jagged line while editing code?arrow_forward
- Python question please include all steps and screenshot of code. Also please provide a docstring, and comments throughout the code, and test the given examples below. Thanks. A single playing card can be represented by a string where the first character is a digit2-9 or a letter ‘A’, ‘T’, ‘J’, ‘Q’, or ‘K’, for Ace, Ten, Jack, Queen, King respectively, andthe second character is one of ‘S’, ‘H’, ‘D’, or ‘C’ for Spades, Hearts, Diamonds, orClubs. A hand of cards can be represented by a list of strings. Write a function calledthreeOfAKind() that takes a list of strings representing a hand of cards, and returns Trueif there are exactly three cards with the same value (regardless of suit), False otherwise.>>> threeOfAKind(['3D', 'KD', 'JD', '3H', '3S'])True>>> threeOfAKind(['3D', 'KD', 'JD', '3H', '4S', '5S'])False>>> threeOfAKind(['3D', '3H', '3S', '3C', 'AC'])Falsearrow_forwardAlert: Don''t submit AI generated answer and give proper step by step answer with an explanation. Question 11 Python allows the programmer to work with text and number files. True Falsearrow_forwardC# programming Question 6 Help of any input, output and comments would be appreciated!arrow_forward
- Python question please include all steps and screenshot of code. Also please provide a docstring, and comments through the code, and test the given examples below. Thanks. If there is a vote at a meeting, there are several possible outcomes based on the numberof yes and no votes (abstains are not counted). If all the votes are yes, then the proposalpasses "unanimously", if at least 2/3 of the votes are yes, then the proposal passes with"absolute majority", if at least 1/2 of the votes are yes, then the proposal passes by"simple majority", and otherwise it fails. Write function vote() that takes as input thenumber of yes votes and the number of no votes and then prints the outcome of the vote.>>> votes(9, 0)proposal passes unanimously>>> votes(6, 3)proposal passes with absolute majority>>> votes(5, 4)proposal passes with simple majority>>> votes(4, 5)arrow_forwardWhile writing code, why should you include comments? Please provide me some specific scenarios in which I might use a remark.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Text book imageComputer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONText book imageComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceText book imageNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Text book imageConcepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningText book imagePrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationText book imageSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY