Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help please do this problem. The previous person didn't follow the prompt. PLEASE remember to use the four functions: string digit(int n, const

image text in transcribed

Can someone help please do this problem. The previous person didn't follow the prompt. PLEASE remember to use the four functions:

string digit(int n, const string symbols);

string ones(int n) { return digit(n, "IVX"); }

string tens(int n) { return digits(n, "XLC"); }

string hundreds(int n) { return digit(n, "CDM"); }

Here is the decToRoman.txt if anyone would like to look at it.

https://pastebin.com/RqR6ubqs

And here is the base code:

/** * @author Put your name here * @date Put the date here * @file h09.cpp */ #include using namespace std;

string STUDENT = "WHO AM I?";

#include "h09.h"

// Put your function implementation (definitions) in this file

/////////// Student Testing /////////////////////// int run() { return 0; }

Roman Times onvert between Arabic, base ten numbers, and Roman numerals. The Roman number system has the digits I, V, X, L, C, D, and M. I Numbers are formed according to the following rules: II 2 1. Only numbers up to 3,999 are represented. 2. As in the decimal system, the thousands, hundreds, tens, and ones are expressed separately. (In other words, it's a positional number system.) III IV nm + 600 VI The numbers 1 to 9 are expressed like the table shown at the right. As you can see, a I preceding a V or X is subtracted from the value, and you can never have more than three I's in a row. VII VIII IX Tens and hundreds are done the same way, except that the let- ters X, L, C, and C, D, M are used instead of I, V, X respectively. The toRoman() function accepts a decimal number such as 1978, and converts it to a string containing the Roman numerals "MCMLXXVIII". An invalid number(0, a negative number, or a number greater than 3,999) returns the string "OUT OF RANGE". Do make things easier for you, I've already written a regular console program that converts integers to Roman numerals. You'll find it in the file decToRoman.txt. Notice that the program is long and complex. Decompose to Roman() using the following four functions, which will be tested separately as well. string digit(int n, const string symbols); string ones (int n) { return digit(n, "IVX"); } string tens (int n) { return digit(n, "XLC"); } string hundreds(int n) { return digit(n, "CDM"); } Roman Times onvert between Arabic, base ten numbers, and Roman numerals. The Roman number system has the digits I, V, X, L, C, D, and M. I Numbers are formed according to the following rules: II 2 1. Only numbers up to 3,999 are represented. 2. As in the decimal system, the thousands, hundreds, tens, and ones are expressed separately. (In other words, it's a positional number system.) III IV nm + 600 VI The numbers 1 to 9 are expressed like the table shown at the right. As you can see, a I preceding a V or X is subtracted from the value, and you can never have more than three I's in a row. VII VIII IX Tens and hundreds are done the same way, except that the let- ters X, L, C, and C, D, M are used instead of I, V, X respectively. The toRoman() function accepts a decimal number such as 1978, and converts it to a string containing the Roman numerals "MCMLXXVIII". An invalid number(0, a negative number, or a number greater than 3,999) returns the string "OUT OF RANGE". Do make things easier for you, I've already written a regular console program that converts integers to Roman numerals. You'll find it in the file decToRoman.txt. Notice that the program is long and complex. Decompose to Roman() using the following four functions, which will be tested separately as well. string digit(int n, const string symbols); string ones (int n) { return digit(n, "IVX"); } string tens (int n) { return digit(n, "XLC"); } string hundreds(int n) { return digit(n, "CDM"); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

How was your trip to the human resource conference?

Answered: 1 week ago

Question

Analyse the various techniques of training and learning.

Answered: 1 week ago