1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Advocard [28]
3 years ago
13

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 Rom

an numeral version of that number. Input Validation: Do not accept a number less than 1 or greater than 10.
Computers and Technology
1 answer:
Studentka2010 [4]3 years ago
7 0

Answer:

// program in C++.

// headers

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// Variable

   int num;

   cout << "Enter a number between 1 and 10: ";

   // read input

   cin >> num;

   // validate input number

   while(num<1||num>10)

   {

   // if input is wrong then print error message

       cout<<"Wrong input!!Enter again:";

       // read again

       cin>>num;

   }

   // print output

   cout << "The Roman numeral for "<<num<<" is:";

   // switch

   switch (num)

   {

       case 1:

       // if input is 1

           cout<<"I"<<endl;

           // exit the switch

           break;

       case 2:

       // if input is 2

           cout<<"II"<<endl;

           // exit the switch

           break;

       case 3:

       // if input is 3

           cout<<"III"<<endl;

           // exit the switch

           break;

       case 4:

       // if input is 4

           cout<<"IV"<<endl;

           // exit the switch

           break;

       case 5:

       // if input is 5

           cout<<"V"<<endl;

           // exit the switch

           break;

       case 6:

       // if input is 6

           cout<<"VI"<<endl;

           // exit the switch

           break;

       case 7:

       // if input is 7

           cout<<"VII"<<endl;

           // exit the switch

           break;

       case 8:

       // if input is 8

           cout<<"VIII"<<endl;

           // exit the switch

           break;

       case 9:

       // if input is 9

           cout<<"IX"<<endl;

           // exit the switch

           break;

       case 10:

       // if input is 10

           cout<<"X"<<endl;

           // exit the switch

           break;

         // default

       default:

           break;

   }

return 0;

}

Explanation:

Read a number from usr and assign it to variable "num". If the input number is less than 1 or greater than 10 then ask again to enter a number until user  enter a number between 1-10 only.Then with the help of switch() function print  the equivalent Roman number.

Output:

Enter a number between 1 and 10: -5                                                                                        

Wrong input!!Enter again:12                                                                                                

Wrong input!!Enter again:6                                                                                                

The Roman numeral for 6 is:VI

You might be interested in
Retail price data for n = 60 hard disk drives were recently reported in a computer magazine. Three variables were recorded for e
BlackZzzverrR [31]

Answer:

Explanation:

Base on the scenario been described in the question, We are 95% confident that the price of a single hard drive with 33 megahertz speed and 386 CPU falls between $3,943 and $4,987

7 0
3 years ago
In the broadest of terms, the performance management process features a cycle that begins with ________________ and concludes wi
Flauer [41]

In the broadest of terms, the performance management process features a cycle that starts with Prerequisites and concludes with performance Review.

<h3>What is performance management process?</h3>

Performance management exists as a communication procedure by which managers and employees work together to plan, monitor, and review an employee's work goals and overall contribution to the organization. Effective performance management exists important to businesses. Through both formal and informal processes, it allows them to align their employees, resources, and systems to complete their strategic objectives.

<h3> Steps of the performance process</h3>
  • Step 1: Create a Performance Management Plan. Create the plan as described as possible, avoiding the usage of ambiguous language.
  • Step 2: Set Goals for Performance Management.
  • Step 3: Complete a Performance Review System.
  • Step 4: Create Strong Feedback-Giving Skills.
  • Step 5: Ongoing Employee Performance Management.

Hence, In the broadest of terms, the performance management process features a cycle that starts with Prerequisites and concludes with performance Review.

To learn more about performance management process refer to:

brainly.com/question/14506325

#SPJ4

3 0
1 year ago
It's possible to __________ out of a loop if the user has entered an incorrect value that would cause an error or a problem with
Stella [2.4K]

Answer:

The answer is Break

<u>Explanation:</u>

When break statement is occurred then, it immediately exits from the loop and executed the statement after the loop without raising any kind of error.

<u>The situation after entering of a value by a user </u>

  • If the user entered incorrect value then it will exit from the loop.
  • If the user entered correct input value, then it will run the loop for the further values.

4 0
3 years ago
Where could an identity theft access your personal information
Nikolay [14]
Hello!

The identity theif could establish a new identity for ciminal purposes using YOUR identity and personal information, and the theif could aquire money or goods from it.

*PLAGIARISM FREE*
5 0
3 years ago
Read 2 more answers
Which of the following computer component facilitates internet connection?
babunello [35]

Answer:

your answer may be(utility software)

8 0
3 years ago
Read 2 more answers
Other questions:
  • How Java provides protection through stack inspection approach ?
    7·1 answer
  • Where do scanned documents go in windows 10?
    11·1 answer
  • What characteristics need to be exhibited by an organisation to improve its software process?
    7·1 answer
  • .How does kinetic energy affect the stopping distance of a vehicle traveling at 30 mph compared to the same vehicle traveling at
    13·1 answer
  • What technique can improve web search results? Add articles, prepositions, and pronouns Be general rather than specific Focus on
    10·1 answer
  • Briley has all the hardware she needs to construct a fully functional personal computer. She connects the various components and
    7·1 answer
  • Which of the following might cause a shift from PPF1 to PPF2? I. A new source of high quality denim fabric. II. A new lighter me
    12·1 answer
  • Which feature allows users to see all suggestions for edits to a document at once?
    7·2 answers
  • What is required to become a good critical thinker? Use a process when dealing with a big issue. Practice the right skills over
    9·1 answer
  • • Do you think documentaries are best delivered in media such as films or documentary?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!