Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program called Roman.java that takes a positive integer between (but not

ID: 3649070 • Letter: W

Question

Write a program called Roman.java that takes a positive integer between (but not including) 0 and 4000 and converts it to Roman Numerals. If you need help with what the Roman numerals are, you can head to http://literacy.kent.edu/Minigrants/Cinci/romanchart.htm

or just hit up Google. Your program should print an error message and exit if the number does not fall into the appropriate range. Your program should throw an exception if the number is not an integer.

INPUT: a positive integer between (but not including) 0 and 4000

OUTPUT: the Roman numerals representing that integer

please use only if and if else statements,scanner,string, ... please do not use any while or for loops

Explanation / Answer

# include using namespace std; //converts base 10 to romans int main() { int num; int quotient; int M = 0; int D = 0; int C = 0; int L = 0; int X = 0; int V = 0; int I = 0; cin >> num; quotient = num/1000; M = quotient; num = num % 1000; quotient = num/500; D = quotient; num = num % 500; quotient = num/100; C = quotient; num = num % 100; quotient = num/50; L = quotient; num = num % 50; quotient = num/10; X = quotient; num = num % 10; quotient = num/5; V = quotient; num = num % 5; I = num; for (int m = 0; m
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote