PART 1. This exercise will have the user enter some information about a movie. 1. Create an enumerated type (enum) that represents movie ratings:    G, PG, PG_13, R, NC_17 (Remember enum names must following C++ variable name rules, so no dashes (-) allowed) 2. Create a STRUCTURE with the following information:     move name     movie rating   DEFINE this as the TYPE of the enum created in step 1.     year produced     main star of the movie, i.e., person     value indicating whether the user saw the movie. Can be a char, int, etc.       storing a Y or N type value     value indicating whether the user liked the movie. Can be a char, int, etc.       storing a Y or N type value      3. Request the above information from the user and store in the structure. The     rating may be requested as follows:         1 - G      2 - PG      3 - PG-13      4 - R      5 - NC-17 NOTE: The following may come in handy: structureVariable.move_ratingVariable = enumType(rating value entered) Where structureVariable    is the variable name of the enum type       move_ratingVariable is the variable name in the structure for move rating       enumType             is the name of the defined enum       rating value entered is the variable containing the rating value the user entered      Try the above before asking!!!      4. Output the information the user entered from the data stored in the STRUCTURE.     The move name, the year, the main star        Output the rating using the enum as follows:         if G - This movie is rated G: General Audiences      if PG - This movie is rated PG : Parental Guidance Suggested      if PG_13 - This movie is rated PG-13: Parent's Strongly Cautioned      if R - This movie is rated R: Under 17 requires accompanying adult or adult guardian      if NC_17 - This movie is rated NC-17: No one under 17 and under admitted        If the user saw the movie output You saw the movie; else output You did not see the movie.        If the user liked the movie, output You Liked the Move; else output You did not like the movie.    PART 2 Read the following carefully to get full value from the practice. This exercise will have you extend the lab performed in part I. Using the code in part I of this lab: 1. Create a function to INPUT the information for the movie. Pass the empty structure in    as a parameter. 2. Create a function to OUTPUT the information in the structure. Pass the filled structure    in as a parameter. 3. Place the ENUM definition, STRUCTURE definition, and FUNCTION prototypes in a HEADER FILE (*.h).    Remove those definitions from the main program and include your header file in the main program    file. DECLARE the STRUCTURE VARIABLE as a LOCAL (not global) variable in the ma

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

PART 1.

This exercise will have the user enter some information about a movie.

1. Create an enumerated type (enum) that represents movie ratings:

   G, PG, PG_13, R, NC_17

(Remember enum names must following C++ variable name rules, so no dashes (-) allowed)

2. Create a STRUCTURE with the following information:

    move name
    movie rating   DEFINE this as the TYPE of the enum created in step 1.
    year produced
    main star of the movie, i.e., person
    value indicating whether the user saw the movie. Can be a char, int, etc.
      storing a Y or N type value
    value indicating whether the user liked the movie. Can be a char, int, etc.
      storing a Y or N type value
    
3. Request the above information from the user and store in the structure. The
    rating may be requested as follows:
  
     1 - G
     2 - PG
     3 - PG-13
     4 - R
     5 - NC-17

NOTE: The following may come in handy: structureVariable.move_ratingVariable = enumType(rating value entered)

Where structureVariable    is the variable name of the enum type
      move_ratingVariable is the variable name in the structure for move rating
      enumType             is the name of the defined enum
      rating value entered is the variable containing the rating value the user entered
    
Try the above before asking!!!
    
4. Output the information the user entered from the data stored in the STRUCTURE.

    The move name, the year, the main star
  
    Output the rating using the enum as follows:
  
     if G - This movie is rated G: General Audiences
     if PG - This movie is rated PG : Parental Guidance Suggested
     if PG_13 - This movie is rated PG-13: Parent's Strongly Cautioned
     if R - This movie is rated R: Under 17 requires accompanying adult or adult guardian
     if NC_17 - This movie is rated NC-17: No one under 17 and under admitted

  
    If the user saw the movie output You saw the movie; else output You did not see the movie.
  
    If the user liked the movie, output You Liked the Move; else output You did not like the movie.
  
PART 2

Read the following carefully to get full value from the practice.

This exercise will have you extend the lab performed in part I. Using the code in part I of
this lab:

1. Create a function to INPUT the information for the movie. Pass the empty structure in
   as a parameter.

2. Create a function to OUTPUT the information in the structure. Pass the filled structure
   in as a parameter.

3. Place the ENUM definition, STRUCTURE definition, and FUNCTION prototypes in a HEADER FILE (*.h).
   Remove those definitions from the main program and include your header file in the main program
   file. DECLARE the STRUCTURE VARIABLE as a LOCAL (not global) variable in the main program.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education