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
guapka [62]
2 years ago
8

Write a program num2rome.cpp that converts a positive integer into the Roman number system. The Roman number system has digits I

1 V 5 X 10 L 50 C 100 D 500 M 1,000 Numbers are formed according to the following rules: a. Only numbers 1 to 3,999 (inclusive) are represented. b. As in the decimal system, the thousands, hundreds, tens, and ones are express separately. c. The numbers 1 to 9 are expressed as I 1 II 2 III 3 IV 4 V 5 VI 6 VII 7 VIII 8 IX 9 As
Computers and Technology
1 answer:
Tom [10]2 years ago
8 0

Answer:

Explanation:

#include <stdio.h>  

int main(void)  

{    

   int num, rem;

   printf("Enter a number: ");

   scanf("%d", &num);

   printf("Roman numerals: ");        

   while(num != 0)

   {

       if (num >= 1000)       // 1000 - m

       {

          printf("m");

          num -= 1000;

       }

       else if (num >= 900)   // 900 -  cm

       {

          printf("cm");

          num -= 900;

       }        

       else if (num >= 500)   // 500 - d

       {            

          printf("d");

          num -= 500;

       }

       else if (num >= 400)   // 400 -  cd

       {

          printf("cd");

          num -= 400;

       }

       else if (num >= 100)   // 100 - c

       {

          printf("c");

          num -= 100;                        

       }

       else if (num >= 90)    // 90 - xc

       {

          printf("xc");

          num -= 90;                                              

       }

       else if (num >= 50)    // 50 - l

       {

          printf("l");

          num -= 50;                                                                      

       }

       else if (num >= 40)    // 40 - xl

       {

          printf("xl");            

          num -= 40;

       }

       else if (num >= 10)    // 10 - x

       {

          printf("x");

          num -= 10;            

       }

       else if (num >= 9)     // 9 - ix

       {

          printf("ix");

          num -= 9;                          

       }

       else if (num >= 5)     // 5 - v

       {

          printf("v");

          num -= 5;                                      

       }

       else if (num >= 4)     // 4 - iv

       {

          printf("iv");

          num -= 4;                                                            

       }

       else if (num >= 1)     // 1 - i

       {

          printf("i");

          num -= 1;                                                                                    

       }

   }

   return 0;

}

You might be interested in
On what dates did the 2016 Olympics take place( list all)
kow [346]
Hi!

The 2016 Olympics took place from August 5th, 2016 - August 21st, 2016.
3 0
3 years ago
Read 2 more answers
How do i unblock a website on a school computer if a school blocks it?
tresset_1 [31]

Answer:

look up ultrasurf and just follow the thingy and it will download a vpn ive had it on my computer for a fat min

Explanation:

4 0
2 years ago
Match the element of a presentation program to its description
lana [24]

Answer:

A) Array of buttons for<u> quick access </u>to commonly used <u>commands and tools</u>: Tool bar

That's what most people will use most of the time, to quickly perform the most common tasks.

B) <u>List of commands</u> to create, format and edit presentations: Menu Bar.

When the features listed in the tool bar aren't enough, we go to the Menu system, which lists all the features of the program.

C) <u>Provides info</u> about current slide<u> at the bottom</u> of the slide: Status Bar.

The status bar is always located at the <u>bottom of the screen</u>.

D) <u>Provides navigation</u> through the slides: Scroll bar.

Where you can scroll down and up your slides.

4 0
3 years ago
// This pseudocode segment is intended to compute the number
Harlamova29_29 [7]

DEBUG01-01

//This pseudocode is intended to describe

//computing the price of an item on sale for 10% off

START

  input origPrice

  discount = origPrice * 0.10

  finalPrice = origPrice - discount

  output finalPrice

STOP

DEBUG01-02

//This pseudocode is intended to compute the number

//of miles per gallon you get with your automobile.

START

  input milesTraveled

  input gallonsOfGasUsed

  milesPerGallon = milesTraveled / gallonsOfGasUsed

     //milesPerGallon is computed using division

  output milesPerGallon

     //miles is misspelled, and the P in milesPerGallon should be uppercase

STOP

  //Program should end with stop

DEBUG01-03

//This pseudocode is intended to describe

//computing the per day cost of your rent

//in a 30-day month

START

  input rent

  costPerDay = rent / 30

     // Comment indicates 30-day month

  output costPerDay

     // output should be costPerDay

STOP

<h3>What is an algorithm?</h3>

An algorithm can be defined as a standard formula which comprises a set of finite steps and instructions that must be executed by a software program, in order to proffer solutions to a problem on a computer, under appropriate conditions.

         

<h3>What is a pseudocode?</h3>

A pseudocode can be defined as a description of the steps that are contained in an algorithm, especially through the use of a plain (natural) language.

<u>Note:</u> The indentation may change due to Brainly's text editor.

Read more on pseudocode here: brainly.com/question/13208346

#SPJ1

<u>Complete Question:</u>

Your downloadable files for Chapter 1 include DEBUG01-01.txt, DEBUG01-02.txt, and DEBUG01-03.txt. Each file starts with some comments (lines that begin with two slashes) that describe the program. Examine the pseudocode that follows the introductory comments, then find and correct all the bugs.

4 0
1 year ago
Eugene wants to indent a paragraph, but the ruler is not present. Which tabs could Eugene use in order to accomplish his goal?
Anton [14]
He could either use the tab key to indent, if you want to make the ruler visible, you can go to the view tab and click the check mark next to show ruler.
8 0
3 years ago
Read 2 more answers
Other questions:
  • A culture that emphasizes verbal communication skills is ____________.
    9·2 answers
  • Which is the highest level of the hierarchy of needs model?
    7·2 answers
  • What is the full word of"VPN"?​
    15·2 answers
  • Does anyone know the answer for this? I’m extremely confused.
    8·2 answers
  • Match the job description to the level of degree it requires.
    15·1 answer
  • Liquid-liquid extraction is best suited to separate a mixture of compounds when:
    9·1 answer
  • ¡Hola! He visto en muchos comentarios de Twitter "svd" cuando alguien dice "dale fav a este Tweet y siganse entre ustedes" y en
    8·1 answer
  • Jonathan is in the process of creating a photo of a fluttering flag with cars moving around in the background. He wants the flag
    13·2 answers
  • Which background-repeat value represents this div?
    6·1 answer
  • WHATS 5X750 i really dont even know that questiob
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!