Question: This will be coded in x 8 6 with Irvine Library For this assignment, you will build a very simple movie review system which uses

This will be coded in x86 with Irvine Library For this assignment, you will build a very simple movie review system which uses structures and macros.
Create a macro named getIntWithRange which has three parameters: a string prompt, a lower bound, and an upper bound. In the macro, print the string prompt and then retrieve an integer from the user. If the number is below the lower bound or above the upper bound, print an error message and ask for another number. Otherwise, return the entered number in EAX.
Create a structure named Movie with a string field for the movie's name, a word field for the movie's length (in minutes), and a 5-index doubleword array named reviews, with each index initialized to 0.
In the reviews array, index 0 represents how many 1-star reviews this movie has received, index 1 represents how many 2-star reviews this movie has received, etc.
In the data segment, create an array of 30 Movie objects named AllMovies, with each index containing an uninitialized Movie object. This is a partially filled array, so add a byte variable named numMovies to track how many movies are in the array.
In your main procedure, ask the user for information for the first movie in the array:
The movie's name.The movie's length.
Use the getIntWithRange macro to ensure the length is in between 30 and 300.
Next, build a menu-based system which gives the user the following options:
Add a movie: If the user chooses this option, ask them for a movie name and length (as before, use getIntWithRange passing 30 and 300). Assign these to the first empty Movie object in the array.Rate a movie: If the user chooses this option, ask them to enter a movie name. Pass the string they input to a procedure named reviewMovie. In this procedure:
See if the movie exists in the array. If it does not, print that it is not found and return. Otherwise:Ask the user how many stars they want to give the movie.
Use the getIntWithRange macro to ensure the rating they enter is in between 1 and 5.
Update the corresponding index in the Movie object's reviews array (i.e. if the user enters 4, increment index 3).
Get average rating. If the user chooses this option, ask them to enter a movie name. Pass the string they input to a procedure named seeAverage. In this procedure:
See if the movie exists in the array. If it does not, print that it is not found and return. Otherwise:Calculate the average star rating for this movie and display it. Note: Since we did not cover floating point values, this average value will be an integer. That is okay!
See all movies. If the user chooses this option, pass the array to a procedure named printMovies. The information for each movie in the array should print (movie title, length, and number of reviews for each star value).Quit.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!