Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, can somebody help me in this Problem Statement: The Super Bowl is among the world's most-watched single sporting events and frequently commands the largest

Hello, can somebody help me in this
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Problem Statement: The Super Bowl is among the world's most-watched single sporting events and frequently commands the largest audience among all American broadcasts during the year. Numerals I through IV were added later for the first four Super Bowls. You will write a C++ program that repeatedly asks the user to input a year for the Super Bowl, and displays the corresponding Super Bowl with Roman Numeral, until the user enters either " Q " or " q " to quit your program. You need to define the following three constants for your program: // The first Super Bowt was hold in 1967 (at Los Angeles Memoriat Cotiseun) const int START_SUPERBOWL = 1967; I/ define the correct range for Roman Numerals: [MIN_ROMAN, MaX_ROMAN] const int MIN_ROMAN =1; const int MAX_ROMAN =3999; You are given a Demonstration program during Today's Lecture, which implements a "Roman Numeral Converter", however it only works for one-digit or two-digit decimal numbers (at the range of [1,99] ). Roman Numbers. (The following description is from ZyBook Programming Project 3.21.13). The Roman number system has digits Nimbers are formed according to the following rules: (1) Only numbers up to 3,999 are represented. (2) As in the decimal system, the thousands, hundreds, tens, and ones are expressed separately. (3) The numbers 1 to 9 are expressed as As you can see, an I preceding a V or X is subtracted from the value, and you can never have more than three I's in a row: (4) Tens and hundreds are done the same way, except that the letters X,L,C and C,D,M are used instead of I,V,X, respectively. As part of the simpler smaller sub-problem to solve in the given demo program, it can only convert the number at the range of [1,99] to its corresponding Roman numeral. For example, if you run this program with an input number, say 68 , and it will convert 68 to Roman numeral, LXVIII. In this project, you need to (1) ask the user to input a four-digit decimal number (representing a year); (2) if the input year is at the range of .1967. 1967+3999-1., your program should display the Super Bowl with the Roman Numeral representation: 1967 is Super Bowl I; 1968 is Super Bowl II; 1969 is Super Bowl III, 1970 is Super Bowi IV,;, 2022 is Super Bowil LVI; 2023 is Super Bowl LVII and 30 on. Besed on the source code of Demonstration program, you should modify the solution to a maller problem into the complete solution to the bigger problem in this Project. You also need to follow the requicements shown below: Special Requirements: 1. You are required to define the following function in Project named roman numeral (), so that main function can call this function to solve the problem: 1/ Purpose: convert the integer n to its corresponding Roman Numeral n must be between 1 and 3999 it returns string form of the Roman Numeral eparam n int: representing the number to convert into Roman Numeral breturn string: representing the corresponding Roman Numeral for n */ string roman_numeral (int n ) ; (Please note that you can define other functions if you think you need to reuse the same block of code more than twice.) 2. Design user-friendly interface: your program should print out the follow information when collecting the user input: The Super Bowl is the annual final playoff game of the NFL to determine the league champion. * The first Super Bow1 took place on January 15, 1967. * Super Bow1 I (Los Angeles Memorial Coliseum) 1967 * This Roman Numerals Convertor is written by Yi pike. * If you had a time machine, which year of Super Bowl * you want to attend (1967 - 5965) ? please enter the year you want to attend (click Q or q to quit) : However, you need to use your name to replace the instructor's name shown above. Why the range of the years is from 1967 to 5965 ? Because the first Super Bowl took place in 1967, and the largest valid Roman number is 3999: starting from 1967, the largest year which can be represented using Roman number is 1967+39991=5965. Think about how to avoid "Magic Number" in your program! 3. User input validation is required for this Project, which means that you can no longer assume that the user will always input "Good Data". (Note that the blue part represents the user input, and "" represents the enter/return key from user input.) Sample output 1: The Super Bowl is the annual final playoff game of the NrL to determine the league champion. * The first Super Bow1 took place on January 15, 1967. * Super Bowl I (Los Angeles Memorial Coliseum) 1967 * This Roman Numerals Convertor is written by Yi Pike. * If you had a time machine, which year of super Bowl * would you want to attend (1967 - 5965) ? please enter the year you want to attend (click Q or q to quit) : Qul Back to 2023, and have a great day! Sample output 2 : The super Bowl is the annual final playoff game of the NFL to determine the league champion. * The first Super Bowl took place on January 15, 1967. * Super Bowl I (Los Angeles Memorial Coliseum) 1967 * This Roman Numerals Convertor is written by Yi Pike. * If you had a time machine, which year of super Bowl * would you want to attend (1967 - 5965)? please enter the year you want to attend (click Q or q to quit) : Two Thousand and threet please use four-digit number to represent a year (1967-5965)

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

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

Be familiar with the five basic ways to manage demand.

Answered: 1 week ago