Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The goal is to write a program to simulate a computerized balloting system for a subset of the categories for the awards program. Provide an

The goal is to write a program to simulate a computerized balloting system for a subset of the categories for the awards program.

Provide an interactive ballot to allow the user to select her favorites in each of the categories using the

categories and nominees below:

Best Picture

Black Panther

BlacKkKlansman

Bohemian Rhapsody

The Favorite

Green Book

Roma

A Star Is Born

Vice

Lead Actress

Yalitza Aparicio, "Roma"

Glenn Close, "The Wife"

Olivia Colman, "The Favourite"

Lady Gaga, "A Star Is Born"

Melissa McCarthy, "Can You Ever Forgive Me?"

Animated Feature

"Incredibles 2", Brad Bird

"Isle of Dogs", Wes Anderson

"Mirai", Mamoru Hosoda

"Ralph Breaks the Internet", Rich Moore, Phil Johnston

"Spider-Man: Into the Spider-Verse", Bob Persichetti, Peter Ramsey, Rodney Rothman

Original Score

"BlacKkKlansman", Terence Blanchard

"Black Panther", Ludwig Goransson

"If Beale Street Could Talk", Nicholas Britell

"Isle of Dogs", Alexandre Desplat

"Mary Poppins Returns", Marc Shaiman, Scott Wittman

Costume Design

"The Ballad of Buster Scruggs", Mary Zophres

"Black Panther", Ruth E. Carter

"The Favourite", Sandy Powell

"Mary Poppins Returns", Sandy Powell

"Mary Queen of Scots", Alexandra Byrne

Visual Effects

"Avengers: Infinity War"

"Christopher Robin"

"First Man"

"Ready Player One"

"Solo: A Star Wars Story"

Makeup and Hair

"Border"

"Mary Queen of Scots"

"Vice"

You will need to do basic data validation to make sure that the value entered for any category is valid.

You can assume that the data will be numeric, as we haven't quite gotten to the advanced regular expression

coverage that we need to test for non-numeric data.

We saw some basic regular expression testing when

introducing the given structure, but that's not sufficient to handle what we would need to handle for non-numeric testing.

Using a 2-d array may help you in shortening your code considerably.

Remember to have #!/usr/bin/env perl as the very first line of your program to use the correct version of Perl installed by perlbrew.

Use use Modern::Perl;in your program.

Make sure to output the categories in the order listed on this handout, and then within each category list the nominees in the order they are listed on this handout.

Points will be deducted if this is not done.

Start all lists of actual nominees with choice 1 instead of choice 0 (i.e., 1 through 5 instead of 0 through 4). Make sure to add in the write-in candidate option.

The format of your output does not have to exactly match the sample output, but part of your grade will be based on how legible your output is.

Your program should not produce any warnings with use Modern::Perl; enabled.

If it does, points will be deducted.

Make sure to fully test all data validation portions of your program.

Sample Run with Examples of Bad Input

Welcome to the 91st Academy Awards!

==============================================================================

The nominees for Best Picture are:

[1] Black Panther

[2] BlacKkKlansman

[3] Bohemian Rhapsody

[4] The Favorite

[5] Green Book

[6] Roma

[7] A Star Is Born

[8] Vice

[9] Write In

Please enter your choice for Best Picture now: 0

I'm sorry, but 0 is not a valid option.

Please enter your choice for Best Picture now: 10

I'm sorry, but 10 is not a valid option.

Please enter your choice for Best Picture now: -1

I'm sorry, but -1 is not a valid option.

Please enter your choice for Best Picture now: 11

I'm sorry, but 11 is not a valid option.

Please enter your choice for Best Picture now: 2

Thank you for selecting BlacKkKlansman as Best Picture.

==============================================================================

The nominees for Lead Actress are:

[1] Yalitza Aparicio, "Roma"

[2] Glenn Close, "The Wife"

[3] Olivia Colman, "The Favourite"

[4] Lady Gaga, "A Star Is Born"

[5] Melissa McCarthy, "Can You Ever Forgive Me?"

[6] Write In

Please enter your choice for Lead Actress now: 4

Thank you for selecting Lady Gaga, "A Star Is Born" as Lead Actress.

==============================================================================

The nominees for Original Score are:

[1] "BlacKkKlansman", Terence Blanchard

[2] "Black Panther", Ludwig Goransson

[3] "If Beale Street Could Talk", Nicholas Britell

[4] "Isle of Dogs", Alexandre Desplat

[5] "Mary Poppins Returns", Marc Shaiman, Scott Wittman

[6] Write In

Please enter your choice for Original Score now: Avengers: Infinity War

I'm sorry, but Avengers: Infinity War is not a valid option.

Please enter your choice for Original Score now: 6

Please enter your write-in candidate: Avengers: Infinity War

Thank you for selecting Avengers: Infinity War as Original Score.

==============================================================================

The nominees for Costume Design are:

[1] "The Ballad of Buster Scruggs", Mary Zophres

[2] "Black Panther", Ruth E. Carter

[3] "The Favourite", Sandy Powell

[4] "Mary Poppins Returns", Sandy Powell

[5] "Mary Queen of Scots", Alexandra Byrne

[6] Write In

Please enter your choice for Costume Design now: 2

Thank you for selecting "Black Panther", Ruth E. Carter as Costume Design.

==============================================================================

The nominees for Visual Effects are:

[1] "Avengers: Infinity War"

[2] "Christopher Robin"

[3] "First Man"

[4] "Ready Player One"

[5] "Solo: A Star Wars Story"

[6] Write In

Please enter your choice for Visual Effects now: 4

Thank you for selecting "Ready Player One" as Visual Effects.

==============================================================================

The nominees for Makeup and Hair are:

[1] "Border"

[2] "Mary Queen of Scots"

[3] "Vice"

[4] Write In

Please enter your choice for Makeup and Hair now: 1

Thank you for selecting "Border" as Makeup and Hair.

Thank you for voting. Here is a summary of your votes:

Best Picture :

BlacKkKlansman

Lead Actress :

Lady Gaga, "A Star Is Born"

Original Score :

Avengers: Infinity War

Costume Design :

"Black Panther", Ruth E. Carter

Visual Effects :

"Ready Player One"

Makeup and Hair :

"Border"

All nominations:

Best Picture

Black Panther

BlacKkKlansman

Bohemian Rhapsody

The Favorite

Green Book

Roma

A Star Is Born

Vice

Lead Actress

Yalitza Aparicio, "Roma"

Glenn Close, "The Wife"

Olivia Colman, "The Favourite"

Lady Gaga, "A Star Is Born"

Melissa McCarthy, "Can You Ever Forgive Me?"

Original Score

"BlacKkKlansman", Terence Blanchard

"Black Panther", Ludwig Goransson

"If Beale Street Could Talk", Nicholas Britell

"Isle of Dogs", Alexandre Desplat

"Mary Poppins Returns", Marc Shaiman, Scott Wittman

Costume Design

"The Ballad of Buster Scruggs", Mary Zophres

"Black Panther", Ruth E. Carter

"The Favourite", Sandy Powell

"Mary Poppins Returns", Sandy Powell

"Mary Queen of Scots", Alexandra Byrne

Visual Effects

"Avengers: Infinity War"

"Christopher Robin"

"First Man"

"Ready Player One"

"Solo: A Star Wars Story"

Makeup and Hair

"Border"

"Mary Queen of Scots"

"Vice"

copy and paste it into your program as starter text for your ballot. Inside your program, you can use the command

:r nominees.txt

and the contents of the nominees.txt file will be read into your Perl source code on the line where your cursor is.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

Describe reviewing applications and rsums.

Answered: 1 week ago

Question

Identify the uses of performance appraisal.

Answered: 1 week ago

Question

Discuss selection in a global environment.

Answered: 1 week ago