Lab 4- Film Information

Due March 19, 11:55

Moodle Link
ft.jpg
Consider the following repl.it: https://repl.it/@JimSkon/FilmViewStart

This program includes functions to read through and list the flim titles in a Film file "film.csv". This is a "comma separated values" file (actully semi-colon separated), e.g. each value on a line has a semi-colon separating it.

Goal

Your goal is to fork the repl.it, and create a program for looking up film information.

Step 1

Update the displayFilm(info) so that it displays ALL the information for a given film, and in a nice readable format. Then make a main() function that loops, calling viewByYear(filename) to display that entered year's films, until the user is done. The parameter "info" is just a parsed line from the file.

Step 2

Make a function called getSubject() that prints the subjects with numbers, and then waits for the users to enter a subject number. Keep asking until they enter a valid subject number. Test this function.

1. Comedy
2. Horror
3. Action
4. Drama
5. Mystery
6. Science Fiction
7. Music
8. War
9. Westerns
10. Western
11. Short
12. Adventure
13. Crime
14. Romance
15. Fantasy

Step 3

Make a function that calls listBySubjects(fileaname). This function should call getSubject(), and then print the matching films using displayFilm(info).

Step 4

Make a function listByActor() that asks the user to enter an actor number to search for, and then checks BOTH the Actor and Actress fields for a partial or full match, listing all the matching movies. You can use the following code examples to see how to search a string for a string: https://repl.it/@JimSkon/SubstringCheck

Make sure the matches ignore the capitalization.

Step 5

Modify the main() function so that it has a loop that asks if the user wants to 1. list by year, 2. list by subject, 3. List by Actor, or 4. end program. Then it calls the appropriate function from above.

Example:
Welcome to the film information program.
Select:
 1. List by year
 2. List by subject
 3. List by actor
 4. exit
1
What year do you want to see movies for? 1925
Film: Joyless Street  Year: 1925 Len: 125 min  Rating: 73
%
Subject: Drama Director: Pabst, Georg Wilhelm
Actor: Stuart, Henry Actress: Garbo, Greta


Welcome to the film information program.
Select:
 1. List by year
 2. List by subject
 3. List by actor
 4. exit
2
1. Comedy
2. Horror
3. Action
4. Drama
5. Mystery
6. Science Fiction
7. Music
8. War
9. Westerns
10. Western
11. Short
12. Adventure
13. Crime
14. Romance
15. Fantasy
Enter a subject number: 17
1. Comedy
2. Horror
3. Action
4. Drama
5. Mystery
6. Science Fiction
7. Music
8. War
9. Westerns
10. Western
11. Short
12. Adventure
13. Crime
14. Romance
15. Fantasy
Enter a subject number: 15
Fantasy
Film: Made in Heaven  Year: 1987 Len: 102 min  Rating: 57%
Subject: Fantasy Director: Rudolph, Alan
Actor: Hutton, Timothy Actress: McGillis, Kelly


Welcome to the film information program.
Select:
 1. List by year
 2. List by subject
 3. List by actor
 4. exit
3
What actor do you want to see movies for? cliff
Film: Charly  Year: 1968 Len: 103 min  Rating: 38
%
Subject: Drama Director: Nelson, Ralph
Actor: Robertson, Cliff Actress: Bloom, Claire

Film: To Die Standing  Year: 1991 Len: 87 min  Rating: 53
%
Subject: Action Director: Morneau, Louis
Actor: De Young, Cliff Actress: Rose, Jamie


Welcome to the film information program.
Select:
 1. List by year
 2. List by subject
 3. List by actor
 4. exit
5

Welcome to the film information program.
Select:
 1. List by year
 2. List by subject
 3. List by actor
 4. exit
   

Program Design

You are to make the functions as specified above. You make make additional helper functions as well.

RequirementPointsCommentsScore
Program provides the required function (search by year, search by subject, search by actor). 40
Code is properly broken up into functions, with one specific task per function. See instructions above. 30
Each function is commented at top of function 10
Program has meaningful comments, good variable names, and good formatting 10
The program has a nice user interface - easy to use. 10
Total

solution

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng Screen_Shot_2018-10-01_at_11.11.14_AM.png r1 manage 148.7 K 2018-10-01 - 15:11 JimSkon  
JPEGjpg ft.jpg r1 manage 77.0 K 2018-10-01 - 01:02 JimSkon  
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r9 - 2019-02-25 - JimSkon
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback