Skip to content

Commit 4d4f57e

Browse files
committed
Added TV data and sample output links to TV Stats instructions
1 parent 334f08e commit 4d4f57e

File tree

4 files changed

+19
-26
lines changed

4 files changed

+19
-26
lines changed

src/com/codefortomorrow/beginner/chapter9/practice/TelevisionStats.java

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
11
package com.codefortomorrow.beginner.chapter9.practice;
22

33
/*
4-
Use parallel arrays to store the following data table
5-
below into parallel arrays so that it can be retrieved as requested.
6-
You may store the information to the arrays however you see fit,
7-
but once it is stored a user should be able to ask for
8-
a specific stat for a specific show.
9-
10-
The program should loop until the user enters “quit” for the show’s name.
11-
Once the user types quit, the program should end.
12-
13-
TOP TV SHOWS * Cited from https://www.ratingraph.com/top_tv_shows/
14-
Title Seasons Episodes Wins Nominations Rating (AVG) Start Year End Year
15-
Game of Thrones 8 73 313 505 8.8 2011 2019
16-
Breaking Bad 5 62 138 217 9.0 2008 2013
17-
The Walking Dead 10 144 69 195 8.1 2010 2020
18-
Supernatural 15 319 22 85 8.5 2005 2020
19-
FRIENDS 10 236 71 211 8.5 1994 2004
20-
Doctor Who 12 156 113 195 7.7 2005 2020
21-
Black Mirror 5 22 23 75 7.9 2011 2020
22-
The Simpsons 31 676 173 309 7.2 1989 2020
23-
The Big Bang Theory 12 281 67 236 7.9 2007 2019
24-
How I Met Your Mother 9 208 25 90 8.2 2005 2014
25-
*/
4+
* Create a program called TelevisionStats
5+
* which takes user input for a show
6+
* and type of statistic and displays the
7+
* statistic asked for. The program should
8+
* end whenever the user enters "quit".
9+
*
10+
* Use separate 1D arrays for the type of stats,
11+
* shows, seasons, episodes, wins, nominations,
12+
* rating, start year, and end year.
13+
*
14+
* The data you need can be found here:
15+
* https://docs.google.com/spreadsheets/d/15A5AdwYm45FZvHizYGYuJXdQJwnKlildm6y8vp4P-jI/edit?usp=sharing
16+
*
17+
* Sample output: https://youtu.be/auKR4KX74q8
18+
*/
2619

2720
public class TelevisionStats {
2821
public static void main (String[]args) {

src/com/codefortomorrow/beginner/chapter9/solutions/TelevisionStats.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* rating, start year, and end year.
1313
*
1414
* The data you need can be found here:
15+
* https://docs.google.com/spreadsheets/d/15A5AdwYm45FZvHizYGYuJXdQJwnKlildm6y8vp4P-jI/edit?usp=sharing
1516
*
16-
*
17-
* Sample output:
17+
* Sample output: https://youtu.be/auKR4KX74q8
1818
*/
1919

2020
import java.util.Scanner;
@@ -138,10 +138,10 @@ public static void main (String[]args) {
138138
System.out.println(shows[index] + " has a rating of " + rating[index]);
139139
break;
140140
case "start year":
141-
System.out.println(shows[index] + " started airing in " + start[index] + " seasons.");
141+
System.out.println(shows[index] + " started airing in " + start[index] + ".");
142142
break;
143143
case "end year":
144-
System.out.println(shows[index] + " last aired in " + end[index] + " seasons.");
144+
System.out.println(shows[index] + " last aired in " + end[index] + ".");
145145
break;
146146
case "quit":
147147
System.out.println("Quitting...");

0 commit comments

Comments
 (0)