answersLogoWhite

0


Best Answer

import java.io.* ;

public class Roman

{

public static void main(String[] args)throws IOException

{

InputStreamReader reader = new InputStreamReader(System.in) ;

BufferedReader br = new BufferedReader (reader) ;

System.out.print("Enter any decimal number between 1 and 59 : ") ;

int n = Integer.parseInt(br.readLine()) ;

String c[] = {"I","II","III","IV","V","VI","VII","VIII","IX","X","L"} ;

String s = "" ;

int t ;

if(n <= 10)

System.out.println("The number '"+n+"' in ROMAN notation is '"+(c[n-1])+"'") ;

else if(n > 10 && n <= 59)

{

int y = n/10 ;

int r = n%10 ;

if(y 0)

s = s+c[10] ;

}

else

{

if(r!=0)

s = s+c[r-1] ;

}

System.out.println("The number '"+n+"' in ROMAN notation is '"+s+"'") ;

}

else

System.out.println("!! FATAL ERROR !! [ No. Greater than 59 ] ") ;

}

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program that converts a decimal number to Roman number. Decimal Number is accepted as command line input at the time of execution.?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program that converts a decimal number to crossponding string .Decimal Number is accepted as command line input at the time of execution?

#include #include using std::cout;using std::cin;using std::endl;using std::string;int main(){string myNumber = "";cout myNumber;cout


Metacharacter indicates background command execution?

The ampersand (&amp;) puts any command in the background to start execution.


What is instruction execution?

The definition of instruction execution is the process of carrying out an instruction by a computer. This is what was formerly known as a command execution in DOS.


What command system is a widely used and accepted tool for command and coordination of a response to a disaster?

Incident Command System is a widely used and accepted tool for command, control, and coordination of a disaster response.


What is the preparatory command for left face?

The prepatory command is "left" while the command of execution is "face."


Two types of command in close order drill?

the two type of command in COD are: the preparatory command ang command of execution! hope it can help ;)


What command system is a widely used and a accepted tool for command controls and coordination of a response to a disaster?

Incident Command System is a widely used and accepted tool for command, control, and coordination of a disaster response.


What command system is a widely used and accepted tool for control command and coordination of a response to a disaster?

Incident Command System is a widely used and accepted tool for command, control, and coordination of a disaster response.


What command tool is widely used and accepted tool for command control and coordination of a response to a disaster?

Incident Command System is a widely used and accepted tool for command, control, and coordination of a disaster response.


What command system system is a widely used and accepted tool for command control and coordination of a response to a disaster?

Incident Command System is a widely used and accepted tool for command, control, and coordination of a disaster response.


What is the part of command?

There are two parts to every command. They are: (one) the preparation and (two) the execution. The preparation tells the band what they are about to do. The execution tells them to do it. For example... "Band...Atten (preparation) Hut!" (execution) "Mark Time (preparation) Hut!" (execution) "Band.....Parade (preparation) Rest!" (execution) Both parts of every command must be done to complete a proper command. The Band/Corps must know what they are supposed to do and when they should do it. Since whistle commands evolved from oral commands, they also have the same two parts. Usually the preparation whistle is done while the drum major does some type of signal with a baton or mace. The execution whistle is a short whistle, or series of short whistles that tells the band to do the command. Make sure that every command is done clearly and has both a preparation and execution. This will keep your band/corps executing your comma


What is the two parts of command?

There are two parts to every command. They are: (one) the preparation and (two) the execution. The preparation tells the band what they are about to do. The execution tells them to do it. For example... "Band...Atten (preparation) Hut!" (execution) "Mark Time (preparation) Hut!" (execution) "Band.....Parade (preparation) Rest!" (execution) Both parts of every command must be done to complete a proper command. The Band/Corps must know what they are supposed to do and when they should do it. Since whistle commands evolved from oral commands, they also have the same two parts. Usually the preparation whistle is done while the drum major does some type of signal with a baton or mace. The execution whistle is a short whistle, or series of short whistles that tells the band to do the command. Make sure that every command is done clearly and has both a preparation and execution. This will keep your band/corps executing your comma