Starting from:
$30

$24

Lab #1 Solution

Problem
In this lab, you will create a movie collection program. You will only be collecting information about a single movie in this lab.

Solution
Your program should display a menu with a list of options for the user.

List Movies
Add Movie
Remove Movie
Quit
Keep displaying the menu until the user elects to quit the program. Note, you may use numeric or letter keys to provide your menu. If you use letters, make it case insensitive.

L) List Movies

A) dd Movie

R) emove Movie

Q)uit




Movie Information
A movie will consist of the following information

Name
Type
Required
Comments
Title
Text
Y
Unique title of the movie.
Description
Text
N
Optional description of the movie.
Length
Integer
N
Length of the movie in minutes (default to 0). If specified then it must be = 0.
Owned
Boolean
Y
True if the movie is owned or false if it is on the wishlist.


Add
Prompt the user for each piece of information about the movie. This lab accepts a single movie. If the user selects to add another movie, overwrite the original movie.

For each value check that the value is correct based upon the rules given earlier and keep prompting the user until the data is valid (i.e. until the length is = 0).
Enter a title:

You must enter a value

Enter a title: star wats : A New Hope

Enter an optional description : Episode 4

Enter the optional Length (in minutes): -1

You must enter a value =0

Enter the optional length (in minutes):150

Do you own this movie




Note: Validating the title is unique is not necessary for this lab since there is only one movie.

List
Display the movie information. Each value should be displayed on its own line with a label indicating what it represents.

If there are no movies then display “No movies available”.

Star Wars: A New Hop

Episode $

Run Length = 150 mins

Status = Owned

Press ENTER to continue





Remove
Prompt the user to confirm they want to delete the movie. If they confirm the deletion then clear the movie information.

Are you sure you want to delete the movie (Y/N)?





Quit
Exit the program.

Requirements
Your program must meet all the following requirements.

Compile cleanly with no warnings or errors.
Meet all the points mentioned in the solution.
Ensure each file has a file header indicating the course, your name and date.
Solution, project and code should be uploaded to Github
Submit lab in MyTCC by providing link to Github URL

More products