Question
what is wrong with this? Write a program that asks the user to enter a number within the range of 1 through 10. Use a
what is wrong with this?
Write a program that asks the user to enter a number within the range of 1 through 10. Use a switch statement to display the Roman numeral version of that number.
Input Validation: Do not accept a number less than 1 or greater than 10.
Prompts And Output Labels. Use the following prompt for input: "Enter a number (1 - 10): ". The output of the program should be of the form "The Roman numeral version of A is R" where A is the Arabic numeral entered (1,2,3,...) and R is the all-capitals form of a Roman numeral, such as VII.
#include
int main(){
int number;
cout<<"Enter a number (1 - 10): ";
cin>> number;
while (number < 1 || number > 10){
cout<<"Please enter a valid number"< cin>>number; } switch (number){ case 1:cout<<"The Roman numeral version of "< break; case 2:cout<<"The Roman numeral version of "< break; case 3:cout<<"The Roman numeral version of "< break; case 4:cout<<"The Roman numeral version of "< break; case 5:cout<<"The Roman numeral version of "< break; case 6:cout<<"The Roman numeral version of "< break; case 7:cout<<"The Roman numeral version of "< break; case 8:cout<<"The Roman numeral version of "< break; case 9:cout<<"The Roman numeral version of "< break; case 10:cout<<"The Roman numeral version of "< break; default: cout<<"Invalid entry."; } return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started