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
joja [24]
3 years ago
10

Write a program roman which converts numbers from decimal notation into Roman numerals. roman takes a single argument, a string

containing a non-negative integer, and prints its Roman numeral equivalent to standard output. g
Computers and Technology
1 answer:
MaRussiya [10]3 years ago
3 0

Answer:

// Program is written in C++ programming language

/ Comments are used for explanatory purpose

// Program starts here

#include<bits/stdc++.h>

using namespace std;

//Declare a function named value to represent the symbols of Roman Numerals

int value(char xy)

{

if (xy == 'I') { return 1; }

if (xy == 'V') { return 5; }

if (xy == 'X') { return 10; }

if (xy == 'L') { return 50; }

if (xy == 'C') { return 100; }

if (xy == 'D') { return 500; }

if (xy == 'M') { return 1000; }

return -1;

}

// Convert to numbers , taking Variable named input as input

int Converted(string &input)

{

// Declare a variable to store the calculated output

int calc;

// Set to 0

calc = 0;

// Iterate through input from 0 to the last character

for (int i=0; i<input.length(); i++)

{

int check1 = value(input[i]);

if (i+1 < input.length())

{

int check12= value(input[i+1]);

// Comparing both values

if (check1>= check2)

{

calc+ =check1;

}

else

{

calc+ =check2 - check1;

i++;

}

}

else

{

calc+ =check1;

}

}

return calc;

}

// Main method starts here

int main()

{

// String input declaration

string inp;

cout<"Enter any valid Roman numeral";

cout << "Result is "

<< Converted(inp);

return 0;

}

You might be interested in
A word feature that joins a data source and a main document to create a customized document is: combine documents. data merge. m
I am Lyosha [343]
Perhaps it is mail merge
5 0
4 years ago
The total cost of a DUI could be as high as----- dollars?<br> a100<br> b500<br> c1000<br> d8000
Svet_ta [14]
the answer is d because depending on your state's laws they can also and endangerment of self and others 
7 0
4 years ago
Read 2 more answers
The address space 0x0000-0x3FF is assigned to I/O peripherals of a given HCS12 chip. How many K bytes is this? (Points : 2) 2K
UNO [17]

Answer:

D. 1K

Explanation:

The address space 0x0000-0x3FF is of 1KB(One Kilo Byte) since 0x3ff is equal to 1023. therefore 1023=1 KB.

bitwise 0x3ff zeros out the top bits of the number such that the result is always between 0 and 1023. It is essentially the same thing as modulo( num,1024) for positive  values of num.

Hence the answer is D 1K

3 0
3 years ago
Write a program that echos back any inputted integer greater than 1, and exits when a 0 is entered. Your program should use a co
denpristay [2]

Answer:

MIPS Code:

.data

newline: .asciiz "\n" #newline variable

.text

MAINLOOP:

li $v0, 5 #syscall to get user interger and store in $v0

syscall

add $a0, $zero, $v0 #moving the user input to $a0 from $v0

beq $a0, 0, EXIT #branching to EXIT when $a0 is 0

li $v0, 1 #syscall to print integer in $a0

syscall

li $v0, 4 #syscall to print newline

la $a0, newline

syscall

j MAINLOOP #jumping to MAINLOOP

EXIT:

Sample Output:

6

6

7

7

3

3

0

7 0
3 years ago
You are the CISO of a company and you need to create logging policies. Please review NIST SP800-92, specifically sections 4–3 th
Kitty [74]

<u>The various systems on a network and develop a logging policy based on the information in the aforementioned sections:</u>

Cisco is router, which is physical device appliance where placed in LAN OR WAN for connecting workstation or desktop or laptop of other offices in organization.

It is a security device and purpose to make organization to access or connected to end use of other networks.

Basically there routers are used ISDN LINE, LEASE LINE or VPN for connecting varies WAN

Purpose of keeping the logging polices to do further analysis how the network packets or traffic is executed and passed different tcpip address. If case any hackers or packet loss the network administrator will do further analysis and protect the system form packet loss or from hackers.  Keeping network logs is policy driven. So network administrator keeps logs for no. of days.

Some network administration export log and keep as reference.

4 0
4 years ago
Other questions:
  • An intranet is a way for a company or organization to protect copyrighted and other important information?
    15·2 answers
  • 1. What are the two things the base of a number system tells you? After describing these two things, illustrate each with exampl
    6·1 answer
  • What are the two main advantages to a well-designed relational database over other types?
    10·1 answer
  • A database interrogation is a major benefit of the database management approach, where end users can query (“ask”) the database
    6·1 answer
  • Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
    7·1 answer
  • The function of network switch is to _____.
    5·1 answer
  • Because mobile users consume information one screen at a time, you should ________ when you're writing to them.
    5·1 answer
  • I’ll mark brainliest if correct
    10·1 answer
  • Choose the missing words in the code below.
    12·1 answer
  • guys look at this https://brainly.com/app/profile/17971193/answers i need help and tips to get this cute girl to give me her num
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!