Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Netflix based java project

  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Netflix based java project

    So before anyone gets suspicious this IS HOMEWORK. So please don't waste your time posting "Do your own homework" because I am NOT asking for answers. Now that I have that out of the way.

    Below I have posted the assignment:

    Your task is to come up with an object-oriented design for a streaming movie rental system
    (like NetFlix). The names of your classes, private instance variables, methods etc. are totally
    up to you.

    Speci cation
    Every user has the following information associated with them:
     A name.
     An account number.
     An ordered playlist of movies. In particular, if movie A is before movie B in the playlist, then the user watches A before B.
     The five most recent movies that the user has watched.

    There are three different kinds of users:

     Trial: A trial user can only have one movie in their playlist at a time.
     Members: A member can have up to 5 movies in their playlist at a time.
    VIP Members: A VIP member can have an unlimited number of movies in their playlist.

    Every user must be able to do the following operations:

     Check-out a movie. If a user checks out a movie, then it is put at the end of the user's playlist.
     Watch a movie: If a user watches a movie, then the movie is removed from the user's playlist. You may assume that the user can only watch whatever movie is at the front of the playlist.
     Recall the five most recent movies that they have watched: This operation should print the most recent movies that the user has watched to the screen.

    Every movie contains the following information:
     A title.
     A date.
     A genre.
     A rental price.

    Notice that different users have different movie rental rights, so it is possible that a user willattempt to do something that (s)he is not allowed to do. When this occurs, you must do thefollowing:

     Make sure that the operation is not performed.
     Print an informative error message that states why the operation could not be performed.
    Your object-oriented design must include the following object-oriented features:

     An abstract class. What should be the base class that other classes build o of?
     Inheritance. In particular, you must inherit from a base abstract class.
     Polymorphism (Dynamic Binding). In particular, your method for checking a movie out must be polymorphic.
    So I know that is a lot of info but I am kinda confused. I have already created the "Movie" class (below)

    import java.util.Date;
     
    public class Movie {
     
    	private String title;
    	private String genre;
    	private int price = 1;
    	private Date d1 = new Date();	 
     
     
     
    	public Movie(String title, int day, int month, int year, String genre,
    			int price) {
    		super();
    		this.title = title;
    		this.genre = genre;
    		this.price = price;
    	}
     
     
     
    	public String getTitle() {
    		return title;
    	}
     
    	public void setTitle(String title) {
    		this.title = title;
    	}
     
    	public String getGenre() {
    		return genre;
    	}
     
    	public void setGenre(String genre) {
    		this.genre = genre;
    	}
     
    	public int getPrice() {
    		return price;
    	}
     
    	public void setPrice(int price) {
    		this.price = price;
    	}
     
     
     
    	public String toString()
    	{
    		return "Title is: " + title +"\n" + "Today's date is: " + d1 + "\n" + "Genre: " + genre + "\n" + "Rental price is: " + price;
    	}
     
    }

    QUESTIONS FOR THE FORUM
    I am working on the "User" class. but I am stuck now because I do not know what I should put into this user class.
    Should I create three separate classes for the three types of memberships or should I just add them ALL into the "User" class. and how would I go about doing this?
    I have a hard time thinking without a skeleton code, could some one help me create a skeleton so I at least know where to BEGIN.
    Thanks again for this wonderful community, I would be failing this course if it was not for this site.


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: Netflix based java project

    Consider creating a User class and a UserState class or enum (better the latter). A User will have a UserState field, and depending on its value, will have different allowed behaviors.

  3. #3
    Junior Member pmc's Avatar
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Netflix based java project

    If you struggle with this type of thing I'd recommend reading the book Beginning Java Objects: From Concepts to Code by Jacquie Barker if you haven't already done so. I found it to be excellent and perfect for getting on the right track for learning how to create software out of objects.

Similar Threads

  1. Java Based WebService
    By ashish12169 in forum Web Frameworks
    Replies: 0
    Last Post: October 5th, 2012, 03:34 AM
  2. May Term project: Physics-based games
    By NcAdams in forum Member Introductions
    Replies: 0
    Last Post: May 22nd, 2012, 02:11 PM
  3. Java based games..
    By imsuperman05 in forum Java Theory & Questions
    Replies: 1
    Last Post: January 12th, 2012, 04:09 PM
  4. jsp/java based open source project
    By the light in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: July 17th, 2011, 03:24 AM
  5. Com based component project using Java
    By jazz2k8 in forum Java Native Interface
    Replies: 1
    Last Post: October 7th, 2008, 10:54 PM

Tags for this Thread