MyFlix

People often give a lot more time to Netflix than they plan to, time that could go into more fruitful work.

Let’s make a simple application to process series details and hence make the user more aware of the time taken to watch a series.

Part 1: Our First Code

Create a new project that will hold all the classes we will use in this app. You may call the project MyFlix App.

  1. Create class Series with these attributes.

2. Compile your class to see if there are any problems with your code.

3. Add the following String variables to your class Series: femaleLead, maleLead.

4. Add one integer and one String attribute of your choice.

5. Create method showSeries() that will output all series details: seasons, epDuration etc. The method declaration and first output statement are given below to help you:

Screenshot 2019-07-23 at 16.20.23

6. Add suitable comments to your code.

7.  Create a class called SeriesApp in which you create your main method.

8.  In the method main:

  • Create an object of Series
  • Give each attribute of you Series object a value
  • Call your method showSeries() for your series object to output series details when the program is run.

9.  Improve the output of your method showSeries() to show the output in the format: Series name: Stranger Things etc.

Part 2: Recapping

In this section we will recap what we’ve done so far and add 2 new properties and 1 new object.

1. Update your TV Series App:

  • Did you include all properties?
  • Does your showSeries() method output all instance variables?
  • Is your code readable?
    • Does your code include meaningful comments?
    • Did you follow code naming conventions?
      • Class names should start with a capital letter
      • method names, variable names and and object names should start with a small letter.  (Use camelCase where necessary)

2.  Add the following properties to your class Series: number of episodes, language

3. Update the method showSeries() accordingly.

4. Do you need some further practice? Create a second object of class Series, and output its details too.

Part 3 – Improving Output Layout

Now we will improve the output layout to make our interface more user-friendly.

  1. Adjust the Option from within BlueJ so that your program runs on a fresh screen.

2.  Use tabs to further improve your output as below:

The above code gives you an example of using \t to move one tab position. There are other useful Escape Characters

Ask Google to find out more about escape characters or go here.

Find Out! What happens if you write the line: System.out.println();

Find Out! What happens if you replace System.out.println(“Name: ” + name); with System.out.print(“Name: ” + name);?

4. Include a method called header() with your app title which is called before outputting each series details.

Part 4: Our own Constructor

We will create a constructor to set a default value for the series language

  1. Write a constructor in class Series to make the language English by default.

Do you need help? Go here

Think! Which line from your main method can you remove now? In which cases would this line still be needed?

Part 5: Let’s Count the Minutes!

Our app will make users aware of the time they devote to watching a series by calculating and outputting the total number of episodes and the time taken to watch the whole series.

1.  In class Series, create a method that finds and outputs the total number of episodes in the series. 

2.  In class Series, create a method that finds and outputs the total time to watch all of the series.

Think! Does your code obey code conventions? Have you used correct indentation?

Part 6: Enter a new Series

Our app will now allow the user to enter their own series details instead.

Think! What new method do you need to add in class Series? What class will you need to import? What code do you need to remove and/or add in method main?

Do you need help? Go here

Part 7: Improving output layout using delays

  1. Edit your program such that it first outputs a title screen.
  2. After a suitable delay, your program should ask the user to input the details of another series.
  3. The program should next output all the details of this series including:
    1. the total number of episodes
    2. the time taken to watch the whole series.

Do you need help? Go here

Part 8: Viewing Statistics

We can now create the final version of our app. To create this final version, you may either create a copy of your app and edit it accordingly or start a new app.

Our app will now give users details about where they are in watching the series by calculating and outputting details about how much of the series they’ve already watched and how much they still have left to watch.

  1. Create an app that asks the user to enter:
    1. Series name
    2. Number of seasons
    3. Episodes per season
    4. Episode duration
    5. How many episodes they’ve watched so far
  2. The app should then output:
    1. The name of the series
    2. The total number of episodes in the series
    3. The time needed to watch the whole series
    4. The number of episodes the user still has to watch
    5. What percentage of the show they’ve watched so far
    6. What percentage they’ve still got to watch
    7. One other statistic you think would be interesting to the user.
  3. This output should be on a fresh screen with a good screen layout.

Part 9:  One step further…

Do you want to take the challenge further? Try one or more of the below!

  1. Allow the user to enter what season and episode he is on (e.g. Season 3 Episode 2). The system will then calculate how many episodes he’s watched in all.
  2. Output time needed to watch the whole series and time left to finish series in hours.
  3. Suggest other activities the user could accomplish in the time left to watch the series (e.g. read a specific book, learn a given skill etc. Google may help here).

Think! Can you think of other features you could add to your app?

Part 10: Your own Application

  • Your application should give the user a looping menu with the following options:
    • Enter a series
    • View Series Details
    • Get Viewing Stats
    • Exit.

Leave a comment

Design a site like this with WordPress.com
Get started