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
Badin Industries runs a web application that processes e-commerce orders and handles credit card transactions. As such, it is su
Novay_Z [31]

Answer:

The correct option is C.

Explanation:

As Badin Industry is using the Payment Card Industry Data Security Standard (PCI DSS) which required the scan to be be done at least annually if there is no change in the application and when the application is changed.

In this context, provided there is no application change the minimum requirement for the scan is once in the year thus the correct option is C.

7 0
3 years ago
Read 2 more answers
From the standpoint of the governing bodies of .com, why is it important that owners of individual domains maintain authoritativ
mixer [17]

Answer:

Explanation:

A subdomain is really important on the internet, we can categorize our blog, e-commerce or simple informative website, for example, if we want to have a blog and e.commerce of the same topic, we can have a subdomain for each website, if we separate our website, and we administrate our content is a good signal for SEO, we could have more promotion in search engine.

4 0
3 years ago
A Cisco Catalyst switch has been added to support the use of multiple VLANs as part of an enterprise network. The network techni
Ostrovityanka [42]

Answer:

The technician should delete the startup configuration and the "vlan.dat" file residing in the flash memory of the newly added switch and lastly, he should reboot the switch.

Explanation:

In this scenario, a Cisco Catalyst switch has been added to support the use of multiple virtual local area networks (VLANs) as part of an enterprise network. The network technician finds it necessary to clear all virtual local area network (VLAN) information from the switch in order to incorporate a new network design. To accomplish this task successfully, the technician should delete the startup configuration and the "vlan.dat" file residing in the flash memory of the newly added switch and lastly, he should reboot the switch. The VLAN informations are stored in a file with the name "vlan.dat" residing in the flash memory of the switch.

However, in order to delete the startup configuration he would be required to login as an administrator, so as to have all privileges.

<em>Also, the essence of deleting the startup configuration and the "vlan.dat" is to avoid any conflict in the network. </em>

8 0
3 years ago
_____ of a global information system (GIS) concentrates on medium-range activities that move an organization toward achieving lo
Dafna11 [192]

Answer: (A) Tactical support

Explanation:

 GIS is the global information system in which the data is delivered worldwide in the form of information system. The global information system achieve long term goals in an organization.

  • The tactical support is used in the global information system for concentrating the activities on the medium range in an organization.  
  • The tactical support is one of the effective way to producing the desirable result and also achieve the main strategic objective.

Therefore, Option (A) is correct.

8 0
3 years ago
A Java programmer has developed a GUI with several different fields for inputting values and indicating choices via buttons, all
stiks02 [169]

Answer:

EventHandler

Explanation:

In order to do this the programmer needs to use the EventHandler class. This class allows the computer to listen for certain user actions such as pressing a button. Using this on a button would then allow the programmer to specify what they want to happen when the user clicks the button or performs a certain action. For example, in this scenario, the programmer would program an EventHandler so that when the button is clicked it saves the input to a variable and changes the input field to the next option.

3 0
3 years ago
Other questions:
  • A publisher has a text-only leader board on top of a page, and a text-only small square ad slot within the content of that page.
    7·1 answer
  • Assume the following variable definitions int a = 5, b = 12; double x = 3.4, z = 9.1. What are the values of the following expre
    7·1 answer
  • To keep from overwriting existing fields with your Lookup you can use the ____________ clause.
    14·2 answers
  • How can i complain a rude comment
    7·1 answer
  • A nonpipelined system takes 300ns to process a task. The same task can be processed in a 5-segment pipeline with a clock cycle o
    10·1 answer
  • What is the information that there are 24 hours in a day and 365 days in a year considered?
    6·2 answers
  • Which of these is the largest?<br> terabyte<br> exabyte<br> gigabyte<br> kilobyte<br> PLEASE HELP
    5·1 answer
  • When compared to defender and analyzer firms, early adopters of new technologies tend to be?
    13·2 answers
  • Open the NetBeans IDE and create a new project named MySizes.java. Your program should do the following:
    9·1 answer
  • Full meaning of CASE in system analysis
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!