Overview. This is in Perl. The 70th Emmy Awards will be held on Monday, Septembe
ID: 3748059 • Letter: O
Question
Overview. This is in Perl.
The 70th Emmy Awards will be held on Monday, September 17th, 2018. 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:
Outstanding Lead Actor in a Comedy Series
Donald Glover, "Atlanta"
Bill Hader, "Barry"
Anthony Anderson, "black-ish"
Larry David, "Curb Your Enthusiasm"
William H. Macy, "Shameless"
Ted Danson, "The Good Place"
Outstanding Lead Actress in a Comedy Series
Pamela Adlon, "Better Things"
Tracee Ellis Ross, "black-ish"
Lily Tomlin, "Grace and Frankie"
Issa Rae, "Insecure"
Allison Janney, "Mom"
Rachel Brosnahan, "The Marvelous Mrs. Maisel"
Outstanding Children's Program
"A Series of Unfortunate Events"
"Alexa & Katie"
"Fuller House"
"Star Wars Rebels"
"The Magical Wand Chase: A Sesame Street Special"
Outstanding Cinematography for a Limited Series or Movie
"Fahrenheit 451"
"Genius: Picasso": "Chapter One"
"Godless": "An Incident at Creede"
"The Alienist": "The Boy On The Bridge"
"Twin Peaks": "Part 8"
"USS Callister (Black Mirror)"
Outstanding Comedy Series
"Atlanta"
"Barry"
"black-rsh"
"Curb Your Enthusiasm"
"GLOW"
"Silicon Valley"
"The Marvelous Mrs. Maisel"
"Unbreakable Kimmy Schmidt"
Outstanding Drama Series
"Game of Thrones"
"Stranger Things"
"The Americans"
"The Crown"
"The Handmaid's Tale"
"This Is Us"
"Westworld"
Outstanding Supporting Actress in a Comedy Series
Zazie Beetz as Van, "Atlanta"
Betty Gilpin as Debbie Eagan, "GLOW"
Laurie Metcalf as Jackie Harris, "Roseanne"
Aidy Bryant as Various Characters, "Saturday Night Live"
Leslie Jones as Various Characters, "Saturday Night Live"
Kate McKinnon as Various Characters, "Saturday Night Live"
Alex Borstein as Susie, "The Marvelous Mrs. Maisel
Megan Mullally as Karen Walker, "Will & Grace"
Each category will have one additional nominee, listed after all of the actual nominees, which will be "Write In". If the user selects the "Write In" nominee, then your program should offer a prompt for the user to type in their own nominee for that category.
Present the categories and nominees exactly in the order listed here:
Outstanding Lead Actor in a Comedy Series
Outstanding Lead Actress in a Comedy Series
Outstanding Children's Program
Outstanding Cinematography for a Limited Series or Movie
Outstanding Comedy Series
Outstanding Drama Series
Outstanding Supporting Actress in a Comedy Series
Record the user's votes, and then print one final summary of their selections in each category at the end of your program.
THIS IS THE FINAL OUTPUT LOOKS LIKE-----
Outstanding Lead Actor in a Comedy Series
Donald Glover, "Atlanta"
Bill Hader, "Barry"
Anthony Anderson, "black-ish"
Larry David, "Curb Your Enthusiasm"
William H. Macy, "Shameless"
Ted Danson, "The Good Place"
Outstanding Lead Actress in a Comedy Series
Pamela Adlon, "Better Things"
Tracee Ellis Ross, "black-ish"
Lily Tomlin, "Grace and Frankie"
Issa Rae, "Insecure"
Allison Janney, "Mom"
Rachel Brosnahan, "The Marvelous Mrs. Maisel"
Sample Run with Examples of Bad Input Welcome to the 7eth Emmy Awards! The nominees for outstanding Lead Actor in a Comedy Series are: [1] Donald Glover, "Atlanta" [2] Bill Hader, "Barry" [3] Anthony Anderson, "black-ish" [4] Larry David, "Curb Your Enthusiasm" [5] William H. Macy, "Shameless" [6] Ted Danson, "The Good Place" [7] Write In Please enter your choice for outstanding Lead Actor in a Comedy Series now: I'm sorry, but -1 is not a valid option. Please enter your choice for outstanding Lead Actor in a Comedy Series now: e I'm sorry, but 0 is not a valid option. Please enter your choice for Outstanding Lead Actor in a Comedy Series now: 2 Thank you for selecting Bill Hader, "Barry" as outstanding Lead Actor in a Comedy series. The nominees for outstanding Lead Actress in a Comedy Series are: [1] Pamela Adlon, "Better Things [2] Tracee Ellis Ross, "black-ish [3] Lily Tomlin, "Grace and Frankie" 4] Issa Rae, "Insecure" [S] Allison Janney, "Mom" [6] Rachel Brosnahan, "The Marvelous Mrs. Maisel" 17] Write In Please enter your choice for outstanding Lead Actress in a Comedy Series now: 6Explanation / Answer
use Switch;
print "Welcome to the 70th Emmy Awards! =================================================================== ";
@leadactor = ("Donald Glover, "Atlanta"","Bill Hader, "Barry"","Anthony Anderson, "Blackish"","Larry David, "Curb Your Enthusiasm"","William H. Macy, "Shameless"","Ted Danson, "The Good Place"","Write In");
@leadactress = ("Pamela Adlon, "Better Things"","Tracee Ellis Ross, "black-ish"","Lily Tomlin, "Grace and Frankie"","Issa Rae, "Insecure"","Allison Janney, "Mom"","Rachel Brosnahan, "The Marvelous Mrs. Maisel"","Write In");
@children = ("A Series of Unfortunate Events","Alexa & Katie","Fuller House","Star Wars Rebels","The Magical Wand Chase: A Sesame Street Special","Write In");
@cinematography = ("Fahrenheit 451","Genius: Picasso": "Chapter One","Godless": "An Incident at Creede","The Alienist": "The Boy On The Bridge","Twin Peaks": "Part 8","USS Callister (Black Mirror)","Write In");
@comedy = ("Atlanta","Barry","black-rsh","Curb Your Enthusiasm","GLOW","Silicon Valley","The Marvelous Mrs. Maisel","Unbreakable Kimmy Schmidt","Write In");
@drama = ("Game of Thrones","Stranger Things","The Americans","The Crown","The Handmaid's Tale","This Is Us","Westworld","Write In");
@support = ("Zazie Beetz as Van, "Atlanta"","Betty Gilpin as Debbie Eagan, "GLOW"","Laurie Metcalf as Jackie Harris, "Roseanne"","Aidy Bryant as Various Characters, "Saturday Night Live"","Leslie Jones as Various Characters, "Saturday Night Live"","Kate McKinnon as Various Characters, "Saturday Night Live"","Alex Borstein as Susie, "The Marvelous Mrs. Maisel"","Megan Mullally as Karen Walker, "Will & Grace"","Write In");
print "The nominees for the Outstanding Lead Actor in a Comedy Series are: ";
for($i=0;$i<7;$i++){
$j=$i+1;
print " [$j] $leadactor[$i] ";
}
$actor=$actress=$child=$cine=$comic=$dra=$sup=0;
print "Print enter your choice for Outstanding Lead Actor in a Comedy Series: ";
$choice = <>;
switch($choice){
case 1 {$actor=$leadactor[0]; print "Thank you for choosing $leadactor[0] as Outstanding Lead Actor in a Comedy Series. ";}
case 2 {$actor=$leadactor[1]; print "Thank you for choosing $leadactor[1] as Outstanding Lead Actor in a Comedy Series. ";}
case 3 {$actor=$leadactor[2]; print "Thank you for choosing $leadactor[2] as Outstanding Lead Actor in a Comedy Series. ";}
case 4 {$actor=$leadactor[3]; print "Thank you for choosing $leadactor[3] as Outstanding Lead Actor in a Comedy Series. ";}
case 5 {$actor=$leadactor[4]; print "Thank you for choosing $leadactor[4] as Outstanding Lead Actor in a Comedy Series. ";}
case 6 {$actor=$leadactor[5]; print "Thank you for choosing $leadactor[5] as Outstanding Lead Actor in a Comedy Series. ";}
case 7 {$actor = <>;}
else {print "I'm sorry, but $choice is not a valid option";}
}
print "=================================================================== ";
print "The nominees for the Outstanding Lead Actress in a Comedy Series are: ";
for($i=0;$i<7;$i++){
$j=$i+1;
print " [$j] $leadactress[$i] ";
}
print "Print enter your choice for Outstanding Lead Actress in a Comedy Series: ";
$choice = <>;
switch($choice){
case 1 {$actress=$leadactress[0]; print "Thank you for choosing $leadactor[0] as Outstanding Lead Actress in a Comedy Series. ";}
case 2 {$actress=$leadactress[1]; print "Thank you for choosing $leadactor[1] as Outstanding Lead Actress in a Comedy Series. ";}
case 3 {$actress=$leadactress[2]; print "Thank you for choosing $leadactor[2] as Outstanding Lead Actress in a Comedy Series. ";}
case 4 {$actress=$leadactress[3]; print "Thank you for choosing $leadactor[3] as Outstanding Lead Actress in a Comedy Series. ";}
case 5 {$actress=$leadactress[4]; print "Thank you for choosing $leadactor[4] as Outstanding Lead Actress in a Comedy Series. ";}
case 6 {$actress=$leadactress[5]; print "Thank you for choosing $leadactor[5] as Outstanding Lead Actress in a Comedy Series. ";}
case 7 {$actress = <>;}
else {print "I'm sorry, but $choice is not a valid option";}
}
print "=================================================================== ";
print "The nominees for the Outstanding Children's Program are: ";
for($i=0;$i<6;$i++){
$j=$i+1;
print " [$j] $children[$i] ";
}
print "Print enter your choice for Outstanding Children's Program: ";
$choice = <>;
switch($choice){
case 1 {$child=$children[0]; print "Thank you for choosing $children[0] as Outstanding Children's Program. ";}
case 2 {$child=$children[1]; print "Thank you for choosing $children[1] as Outstanding Children's Program. ";}
case 3 {$child=$children[2]; print "Thank you for choosing $children[2] as Outstanding Children's Program. ";}
case 4 {$child=$childrenchildren[3]; print "Thank you for choosing $children[3] as Outstanding Children's Program. ";}
case 5 {$child=$children[4]; print "Thank you for choosing $children[4] as Outstanding Children's Program. ";}
case 6 {$child=<>;}
else {print "I'm sorry, but $choice is not a valid option";}
}
print "=================================================================== ";
print "The nominees for the Outstanding Cinematography for a Limited Series or Movie: ";
for($i=0;$i<7;$i++){
$j=$i+1;
print " [$j] $cinematography[$i] ";
}
print "Print enter your choice for Outstanding Cinematography for a Limited Series or Movie: ";
$choice = <>;
switch($choice){
case 1 {$cine=$cinematography[0]; print "Thank you for choosing $cinematography[0] as Outstanding Cinematography for a Limited Series or Movie. ";}
case 2 {$cine=$cinematography[1]; print "Thank you for choosing $cinematography[1] as Outstanding Cinematography for a Limited Series or Movie. ";}
case 3 {$cine=$cinematography[2]; print "Thank you for choosing $cinematography[2] as Outstanding Cinematography for a Limited Series or Movie. ";}
case 4 {cine$cine=$cinematography[3]; print "Thank you for choosing $cinematography[3] as Outstanding Cinematography for a Limited Series or Movie. ";}
case 5 {cine=$cinematography[4]; print "Thank you for choosing $cinematography[4] as Outstanding Cinematography for a Limited Series or Movie. ";}
case 6 {$cine=$cinematography[5]; print "Thank you for choosing $cinematography[5] as Outstanding Cinematography for a Limited Series or Movie. ";}
case 7 {$cine = <>;}
else {print "I'm sorry, but $choice is not a valid option";}
}
print "=================================================================== ";
print "The nominees for the Outstanding Comedy Series: ";
for($i=0;$i<9;$i++){
$j=$i+1;
print " [$j] $comedy[$i] ";
}
print "Print enter your choice for Outstanding Comedy Series: ";
$choice = <>;
switch($choice){
case 1 {$comiccomedy=$comedy[0]; print "Thank you for choosing $comedy[0] as Outstanding Comedy Series. ";}
case 2 {$comiccomedy=$comedy[1]; print "Thank you for choosing $comedy[1] as Outstanding Comedy Series. ";}
case 3 {$comiccomedy=$comedy[2]; print "Thank you for choosing $comedy[2] as Outstanding Comedy Series. ";}
case 4 {$comiccomedy=$comedy[3]; print "Thank you for choosing $comedy[3] as Outstanding Comedy Series. ";}
case 5 {$comiccomedy=$comedy[4]; print "Thank you for choosing $comedy[4] as Outstanding Comedy Series. ";}
case 6 {$comiccomedy=$comedy[5]; print "Thank you for choosing $comedy[5] as Outstanding Comedy Series. ";}
case 7 {$comiccomedy=$comedy[6]; print "Thank you for choosing $comedy[6] as Outstanding Comedy Series. ";}
case 8 {$comiccomedy=$comedy[7]; print "Thank you for choosing $comedy[7] as Outstanding Comedy Series. ";}
case 9 {$comiccomedy = <>;}
else {print "I'm sorry, but $choice is not a valid option";}
}
print "=================================================================== ";
print "The nominees for the Outstanding Drama Series: ";
for($i=0;$i<8;$i++){
$j=$i+1;
print " [$j] $drama[$i] ";
}
print "Print enter your choice for Outstanding Drama Series: ";
$choice = <>;
switch($choice){
case 1 {$dra=$drama[0]; print "Thank you for choosing $drama[0] as Outstanding Drama Series. ";}
case 2 {$dra=$drama[1]; print "Thank you for choosing $drama[1] as Outstanding Drama Series. ";}
case 3 {$dra=$drama[2]; print "Thank you for choosing $drama[2] as Outstanding Drama Series. ";}
case 4 {$dra=$drama[3]; print "Thank you for choosing $drama[3] as Outstanding Drama Series. ";}
case 5 {$dra=$drama[4]; print "Thank you for choosing $drama[4] as Outstanding Drama Series. ";}
case 6 {$dra=$drama[5]; print "Thank you for choosing $drama[5] as Outstanding Drama Series. ";}
case 7 {$dra=$drama[6]; print "Thank you for choosing $drama[6] as Outstanding Drama Series. ";}
case 8 {$dra=<>;}
else {print "I'm sorry, but $choice is not a valid option";}
}
print "=================================================================== ";
print "The nominees for the Outstanding Supporting Actress in a Comedy Series: ";
for($i=0;$i<8;$i++){
$j=$i+1;
print " [$j] $support[$i] ";
}
print "Print enter your choice for Outstanding Supporting Actress in a Comedy Series: ";
$choice = <>;
switch($choice){
case 1 {$sup=$support[0]; print "Thank you for choosing $support[0] as Outstanding Supporting Actress in a Comedy Series. ";}
case 2 {$sup=$support[1]; print "Thank you for choosing $support[1] as Outstanding Supporting Actress in a Comedy Series. ";}
case 3 {$sup=$support[2]; print "Thank you for choosing $support[2] as Outstanding Supporting Actress in a Comedy Series. ";}
case 4 {$sup=$support[3]; print "Thank you for choosing $support[3] as Outstanding Supporting Actress in a Comedy Series. ";}
case 5 {$sup=$support[4]; print "Thank you for choosing $support[4] as Outstanding Supporting Actress in a Comedy Series. ";}
case 6 {$sup=$support[5]; print "Thank you for choosing $support[5] as Outstanding Supporting Actress in a Comedy Series. ";}
case 7 {$sup=$support[6]; print "Thank you for choosing $support[6] as Outstanding Supporting Actress in a Comedy Series. ";}
case 8 {$sup=<>;}
else {print "I'm sorry, but $choice is not a valid option";}
}
print "=================================================================== ";
print "Thank you for voting. Here is a summary of your votes: ";
print "Outstanding Lead Actor in a Comedy Series: $actor";
print "Outstanding Lead Actress in a Comedy Series: $actress";
print "Outstanding Children's Program: $child";
print "Outstanding Cinematography for a Limited Series or Movie: $cine";
print "Outstanding Comedy Series: $comic";
print "Outstanding Drama Series: $dra";
print "Outstanding Supporting Actress in a Comedy Series: $sup";
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.