Help plz :Use VOID fct to write Roman Convert program

Hello ,
This program contains the following functions:
Roman : This function needs the year entered by the user and returns the Roman numeral string that represents that year
PrintResults :This routine needs both the year entered by the user as well as the roman numeral string.It prints the message to the screen and returns no value.
Is it mean void PrintResults(int , string) ?
Please help me ! Thank you
This is my program without using void function :
#include <iostream>
#include<string>
using namespace std;

/***************** PROTOTYPES FUNCTION*****************/

/******************************************************/

int main ()
{
int Roman;
string RomanNumerals;
string thousands;
string hundreds;
string tens;
string ones;

char answer;
do
{
// Ask user to enter year
cout << "Enter a number between 1 and 3,999: ";
cin>>Roman;

if (Roman<1|| Roman >=4000)
cout << "Cannot convert that number: out of range ";

else
{
if (Roman/1000==3) // Do in thousands
thousands="MMM";
else if (Roman/1000==2)
thousands="MM";
else if (Roman/1000==1)
thousands="M";
else
thousands=" ";


if ((Roman%1000)/100==9) // Do in hundreds
hundreds="CM";
else if ((Roman%1000)/100==8)
hundreds="DCCC";
else if((Roman%1000)/100==7)
hundreds="DCC";
else if ((Roman%1000)/100==6)
hundreds="DC";
else if ((Roman%1000)/100==5)
hundreds="D";
else if ((Roman%1000)/100==4)
hundreds="CD";
else if ((Roman%1000)/100==3)
hundreds="CCC";
else if ((Roman%1000)/100==2)
hundreds="CC";
else if ((Roman%1000)/100==1)
hundreds="C";
else
hundreds=" ";

if (((Roman%1000)%100)/10==9) // Do in tens
tens="XC";
else if (((Roman%1000)%100)/10==8)
tens="LXXX";
else if (((Roman%1000)%100)/10==7)
tens="LXX";
else if (((Roman%1000)%100)/10==6)
tens="LX";
else if (((Roman%1000)%100)/10==5)
tens="L";
else if (((Roman%1000)%100)/10==4)
tens="XL";
else if (((Roman%1000)%100)/10==3)
tens="XXX";
else if (((Roman%1000)%100)/10==2)
tens="XX";
else if (((Roman%1000)%100)/10==1)
tens="X";
else
tens=" ";

if (((Roman%1000)%100)%10==9) // Do in ones
ones="IX";
else if (((Roman%1000)%100)%10==8)
ones="VIII";
else if (((Roman%1000)%100)%10==7)
ones="VII";
else if (((Roman%1000)%100)%10==6)
ones="VI";
else if (((Roman%1000)%100)%10==5)
ones="V";
else if (((Roman%1000)%100)%10==4)
ones="IV";
else if (((Roman%1000)%100)%10==3)
ones="III";
else if (((Roman%1000)%100)%10==2)
ones="II";
else if (((Roman%1000)%100)%10==1)
ones="I";
else
ones=" ";

// Connect all of string thousands, hundreds, tens , ones together

RomanNumerals=thousands + hundreds+ tens+ ones;
// Print out to the screen
cout << "The roman number equivalent of " <<Roman<<" is "<<RomanNumerals;

}

cout << "\nWould you like to enter another year ? ";
cin>>answer;
}while(answer=='y');
re[/sup]turn 0;[/small]

}
Topic archived. No new replies allowed.