Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C PROGRAMMING Problem Statement 2 Given an integer representing a score in a National Football League (NFL) game, write a program to determine all possible

C PROGRAMMINGimage text in transcribed

Problem Statement 2 Given an integer representing a score in a National Football League (NFL) game, write a program to determine all possible combinations of scoring plays that can result in that score. A scoring plays in an NFL game can be the following: - Touchdown (TD) worth 6 points - Field goal (FG) worth 3 points - Safety worth 2 points - Touchdown (TD) + 2-point conversion worth 8 points - Touchdown (TD) + 1-point field goal worth 7 points The program should continue to prompt the user for a score until a value less than or equal to 1 is entered, at which point the program should terminate. For each score entered, the program should display all possible combinations of scoring plays that result in that score. Sample Input Enter 0 or 1 to STOP Enter the NFL score: 25 Sample Output: possible combinations of scoring plays: 0TD+2pt,0TD+FG,0 TD, 1 3pt FG, 11 Safety 0 TD + 2pt, 0 TD + FG, 0 TD, 3 3pt FG, 8 Safety 0 TD + 2pt, 0 TD + FG, 0 TD, 5 3pt FG, 5 Safety 0TD+2pt,0TD+FG,0TD,73ptFG,2 Safety 0 TD + 2pt, 0 TD + FG, 1 TD, 1 3pt FG, 8 Safety 0 TD + 2pt, 0 TD + FG, 1 TD, 3 3pt FG, 5 Safety 0 TD + 2pt, 0 TD + FG, 1 TD, 5 3pt FG, 2 Safety 0 TD + 2pt, 0 TD + FG, 2 TD, 1 3pt FG, 5 Safety 0 TD + 2pt, 0 TD + FG, 2 TD, 3 3pt FG, 2 Safety 0 TD + 2pt, 0 TD + FG, 3 TD, 1 3pt FG, 2 Safety 0 TD + 2pt, 1 TD + FG, 0 TD, 0 3pt FG, 9 Safety 0 TD + 2pt, 1 TD + FG, 0 TD, 2 3pt FG, 6 Safety 0 TD + 2pt, 1 TD + FG, 0 TD, 4 3pt FG, 3 Safety 0 TD + 2pt, 1 TD + FG, 0 TD, 6 3pt FG, 0 Safety 0 TD + 2pt, 1 TD + FG, 1 TD, 0 3pt FG, 6 Safety 0 TD + 2pt, 1 TD + FG, 1 TD, 2 3pt FG, 3 Safety 0 TD + 2pt, 1 TD + FG, 1 TD, 4 3pt FG, 0 Safety 0 TD + 2pt, 1 TD + FG, 2 TD, 0 3pt FG, 3 Safety 0 TD + 2pt, 1 TD + FG, 2 TD, 2 3pt FG, 0 Safety 0 TD + 2pt, 1 TD + FG, 3 TD, 0 3pt FG, 0 Safety 0 TD + 2pt, 2 TD + FG, 0 TD, 1 3pt FG, 4 Safety 0 TD + 2pt, 2 TD + FG, 0 TD, 3 3pt FG, 1 Safety 0 TD + 2pt, 2 TD + FG, 1 TD, 1 3pt FG, 1 Safety 0 TD + 2pt, 3 TD + FG, 0 TD, 0 3pt FG, 2 Safety 1 TD + 2pt, 0 TD + FG, 0 TD, 1 3pt FG, 7 Safety 1 TD + 2pt, 0 TD + FG, 0 TD, 3 3pt FG, 4 Safety 1 TD + 2pt, 0 TD + FG, 0 TD, 5 3pt FG, 1 Safety 1 TD + 2pt, 0 TD + FG, 1 TD, 1 3pt FG, 4 Safety 1 TD + 2pt, 0 TD + FG, 1 TD, 3 3pt FG, 1 Safety 1 TD + 2pt, 0 TD + FG, 2 TD, 1 3pt FG, 1 Safety 1 TD + 2pt, 1 TD + FG, 0 TD, 0 3pt FG, 5 Safety 1 TD + 2pt, 1 TD + FG, 0 TD, 2 3pt FG, 2 Safety 1 TD + 2pt, 1 TD + FG, 1 TD, 0 3pt FG, 2 Safety 1 TD + 2pt, 2 TD + FG, 0 TD, 1 3pt FG, 0 Safety 2 TD + 2pt, 0 TD + FG, 0 TD, 1 3pt FG, 3 Safety 2 TD + 2pt, 0 TD + FG, 0 TD, 3 3pt FG, 0 Safety 2 TD + 2pt, 0 TD + FG, 1 TD, 1 3pt FG, 0 Safety 2 TD + 2pt, 1 TD + FG, 0 TD, 0 3pt FG, 1 Safety

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

Understand how arbitrators are credentialed and selected

Answered: 1 week ago