] Write a program that prompts a user to enter a year between 1 and 2499 and prints its century in the format such as 1st, 2nd, 3rd, 4th, etc. Use a switch statement. for what we have done in class so far we have only used    #include , so if possible if this can be done using that so I can understand for my next assignment that would be great thanks! Test Run 1: Enter a year between 1 and 2499 -- 1923 1923 is in the 20th century Test Run 2: Enter a year between 1 and 2499 -- 2202 2202 is in the 23rd century Test Run 3: Enter a year between 1 and 2499 -- 2630 Wrong year!

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

] Write a program that prompts a user to enter a year between 1 and 2499 and prints its century in the format such as 1st, 2nd, 3rd, 4th, etc. Use a switch statement. for what we have done in class so far we have only used    #include <iostream> <fstream> <cmath> <string> <iomanip>, so if possible if this can be done using that so I can understand for my next assignment that would be great thanks!

Test Run 1:
Enter a year between 1 and 2499 -- 1923
1923 is in the 20th century

Test Run 2:
Enter a year between 1 and 2499 -- 2202
2202 is in the 23rd century

Test Run 3:
Enter a year between 1 and 2499 -- 2630
Wrong year!

 

Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning