We are in the month of February, we want the user to enter a number N and guess which month it will be in N months, then your program will check whether the user's guess is correct or wrong and display a message accordingly. e.g. Since if we are in February, if the user enters 8 for N and April for the guessed month, meaning that 8 months from now, it will be April. Your program should find out that the user's guess is wrong and display a message. See below examples of input/output. Notes: • Use the assert function to make sure that the number of months entered by the user is positive. • Use the modulo operator and a switch statement to find the correct month. • e.g. if we are in February, then after 8 months the month will be October as (2+8) % 12 = 10: the 8th month following February is October. After 11 months from February as (2+11) %12=1: The 11th Month from February is January. After 41 months from February, the month is July as (2+41) %12=7 • Include the header file to be able to use the type string: #include. • Declare the 12 months as constants of type string. e.g. const string This_month = "February"; const string Jan= "January"; const string jan = "January"; • Your program should consider months with uppercase first letter or lowercase first letter. e.g. given the above two constants Jan and jan, if guessedMonth is the name of the variable containing the guessed month entered by the user, then you can make this test: if(guessedMonth == Jan || guessedMonth == jan) to check that the user input is "January" or "january"

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

Please send me answer of this question immediately and i will give you like sure sir 

We are in the month of February, we want the user to enter a number N and guess which month it will be in N months, then your
program will check whether the user's guess is correct or wrong and display a message accordingly.
e.g. Since if we are in February, if the user enters 8 for N and April for the guessed month, meaning that 8 months from now, it will
be April. Your program should find out that the user's guess is wrong and display a message. See below examples of input/output.
Notes:
• Use the assert function to make sure that the number of months entered by the user is positive.
• Use the modulo operator and a switch statement to find the correct month.
• e.g. if we are in February, then after 8 months the month will be October as (2+8) % 12 = 10: the 8th month following
February is October. After 11 months from February as (2+11) %12 = 1: The 11th Month from February is January.
After 41 months from February, the month is July as (2+41) %12=7
• Include the <cstring> header file to be able to use the type string: #include<cstring>.
• Declare the 12 months as constants of type string.
e.g. const string This_month = "February";
const string Jan= "January";
const string jan= "January";
• Your program should consider months with uppercase first letter or lowercase first letter.
e.g. given the above two constants Jan and jan, if guessed Month is the name of the variable containing the guessed month entered
by the user, then you can make this test:
if(guessedMonth == Jan || guessed Month == jan)
to check that the user input is "January" or "january"
с
Transcribed Image Text:We are in the month of February, we want the user to enter a number N and guess which month it will be in N months, then your program will check whether the user's guess is correct or wrong and display a message accordingly. e.g. Since if we are in February, if the user enters 8 for N and April for the guessed month, meaning that 8 months from now, it will be April. Your program should find out that the user's guess is wrong and display a message. See below examples of input/output. Notes: • Use the assert function to make sure that the number of months entered by the user is positive. • Use the modulo operator and a switch statement to find the correct month. • e.g. if we are in February, then after 8 months the month will be October as (2+8) % 12 = 10: the 8th month following February is October. After 11 months from February as (2+11) %12 = 1: The 11th Month from February is January. After 41 months from February, the month is July as (2+41) %12=7 • Include the <cstring> header file to be able to use the type string: #include<cstring>. • Declare the 12 months as constants of type string. e.g. const string This_month = "February"; const string Jan= "January"; const string jan= "January"; • Your program should consider months with uppercase first letter or lowercase first letter. e.g. given the above two constants Jan and jan, if guessed Month is the name of the variable containing the guessed month entered by the user, then you can make this test: if(guessedMonth == Jan || guessed Month == jan) to check that the user input is "January" or "january" с
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Random Class and its operations
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.
Similar questions
  • SEE MORE QUESTIONS
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