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
Alenkinab [10]
2 years ago
12

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. Sample Run Enter a number (1 - 10): 7↵ The Roman numeral version of 7 us VII.↵
Computers and Technology
1 answer:
hjlf2 years ago
6 0

Answer:

Below are the program for the above question:

Explanation:

#include <stdio.h>//header file.

int main()//main function.

{

   int value; //variable declaration.

   printf("Enter a number to find its roman value: ");//render a message for the user.

   scanf("%d",&value); //take a value from the user.

   switch(value)//switch case starts

   {

     case 1:

     printf("I");

     break;

     case 2:

     printf("II");

     break;

     case 3:

     printf("III");

     break;

     case 4:

     printf("IV");

     break;

     case 5:

     printf("V");

     break;

     case 6:

     printf("VI");

     break;

     case 7:

     printf("VII");

     break;

     case 8:

     printf("VIII");

     break;

     case 9:

     printf("IX");

     break;

     case 10:

     printf("X");

     break;

   }//switch case ends.

   return 0;//return statement.

}

Output:

  • If the user inputs as 4, then the output is "IV".

Code Explantion :

  • The above code is in c language, in which the scanf function is used to take the inputs from the user.
  • Then the value match from the switch case and display the suitable result.
  • And the user get the roman value from the user.

You might be interested in
Which company provides a crowdsourcing platform for corporate research and development?
777dan777 [17]

Answer:

OA.

MTurk(mechanical turk)

Explanation:

Mechanical Turk is a Microwork service provided by Amazon. Correct answer: C It is an online “crowdsourcing” marketplace that was launched in 2005 by Amazon.

This site (service)   allows businesses and individuals to post short tasks and pay workers to complete them.

6 0
3 years ago
Select the correct answer.
SpyIntel [72]

Answer:

i think real time fluid dynamics

Explanation:

3 0
2 years ago
write a c++program that allows the user to enter the last names of fivecandidates in a local election and the number of votes re
madreJ [45]

Answer:

#include<iostream>

#include<stdlib.h>

using namespace std;

int main(){

   //initialization

   string str1[5];

   int arr_Vote[5];

   int Total_Vote=0,max1_Index;

   int max1=INT_MIN;

   //loop for storing input enter by user

   for(int i=0;i<5;i++){

       cout<<"Enter the last name of candidate: "<<endl;

       cin>>str1[i];

       cout<<"Enter the number of vote receive by the candidate: "<<endl;

       cin>>arr_Vote[i];

       //calculate the sum

       Total_Vote = Total_Vote + arr_Vote[i];

       //find the index of maximum vote

       if(arr_Vote[i]>max1){

           max1=arr_Vote[i];

           max1_Index=i;

       }

   }

   //display

   cout<<"\nThe output is......"<<endl;

   //loop for display data of each candidate

   for(int i=0;i<5;i++){

       cout<<str1[i]<<"\t"<<arr_Vote[i]<<"\t"     <<float(arr_Vote[i]*100)/Total_Vote<<"%"<<endl;

   }

   //display winner

   cout<<"The winner candidate is"<<endl;

   cout<<str1[max1_Index]<<"\t"<<arr_Vote[max1_Index]<<"\t"<<float(arr_Vote[max1_Index]*100)/Total_Vote<<" %"<<endl;

}

Explanation:

Create the main function and declare the two arrays and variables.

the first array for storing the names, so it must be a string type. second array stores the votes, so it must be int type.

after that, take a for loop and it runs for 5 times and storing the values entered by the user in the arrays.

we also calculate the sum by adding the array data one by one.

In the same loop, we also find the index of the maximum vote. take an if statement and it checks the element in the array is greater than the max1 variable. Max1 variable contains the very small value INT_MIN.

If condition true, update the max1 value and update the max1_Index value.

The above process continues for each candidate for 5 times.

After that, take a for loop and display the data along with percentage by using the formula:

Vote\,percent=\frac{Vote\,receive*100}{Total\,vote}

the, finally display the winner by using the max1_Index value.  

5 0
2 years ago
To meet the requirement for the number of vdss on board, what must be true about pyrotechnic vdss?
asambeis [7]

Answer: They must be dated.

Explanation: If pyrotechnic VDSs are used, they must be dated. Expired VDSs may be carried on board, but a minimum of three unexpired VDSs must be carried in the vessel.

5 0
2 years ago
Which of the following savings vehicles usually requires a high minimum balance
GuDViN [60]
A Savings Vehicle is an effective way to hold your savings. It could be a savings account. But some requires a high minimum balance such as Certificate of Deposit (CD). It is generally issued by commercial banks.  It is a time deposit too and restricts you from withdrawing funds.
7 0
3 years ago
Other questions:
  • Why should you thank the customer after resolving an issue?
    7·2 answers
  • Which of the following is NOT a good idea to do after you change the root password?
    12·1 answer
  • The first time you save a document, which screen appears
    8·2 answers
  • Ada lovelace designed the first computer
    7·1 answer
  • Why are specification for food processing tool,equipmentand untensils necessary?​
    8·1 answer
  • 16. Which of the following wire gage sizes is the thickest? A. 14 B. 8 C. 0 D. -33
    14·1 answer
  • Giving Brainliest IFFF CORRECT
    9·1 answer
  • Given two int variables , firstplacewinner and secondplacewinner, write some code that swaps their values . declare any addition
    11·1 answer
  • What kind of energy transformation occurs when you call someone on a cell phone?
    11·1 answer
  • SHA-1 produces a(n) ___________-bit message digest, which can then be used as an input to a digital signature algorithm.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!