i have an assignment which basically takes whatever the users inputs, and outputs and translates it to Roman numerals. numbers----->Roman numerals
here is the link that explains everything in more detail
http://home.earthlink.net/%7Ecraie/1.../romannum.html
i understand the pattern but i'm stuck on how to reduce the code
this is what i got so far
what i'm basically doing now is taking different Roman numerals and adding them together to get new ones. but, what i discovered that if i keep this kind of pace up, it will take me a LONG time to finish! no 0 in Roman numerals; and the limit is 3999. can anyone help me out to get started the right way to write out the code for the Roman numeral pattern? also, "Why will the program only work for values in the (integral) range [1..3999]? "thanks in advanceCode:[tag]#include <string> #include <iostream> using namespace std; int main() { string rome; string rome1="I"; string rome2=rome1+rome1; string rome3=rome2+rome1; string rome4="IV"; string rome5="V"; string rome6=rome5+rome1; string rome7=rome6+rome1; string rome8=rome7+rome3; string rome9="IX"; string rome10="X"; return 0; } [/tag]
btw, only strings,loops,and nest/branches are to be used in this program



LinkBack URL
About LinkBacks




kinda