Comment revisions

This commit is contained in:
Arogon1
2019-12-10 23:35:54 -05:00
parent 862ac23992
commit 79d29c0bd3
10 changed files with 42 additions and 12 deletions

View File

@ -5,7 +5,7 @@ import java.util.Scanner;
/**
* This class converts a Decimal number to a Binary number
*
* @author Unknown
*
*/
class DecimalToBinary {

View File

@ -1,5 +1,6 @@
package Conversions;
//hex = [0 - 9] -> [A - F]
class DecimalToHexaDecimal {
private static final int sizeOfIntInHalfBytes = 8;
private static final int numberOfBitsInAHalfByte = 4;

View File

@ -5,7 +5,7 @@ import java.util.Scanner;
/**
* This class converts Decimal numbers to Octal Numbers
*
* @author Unknown
*
*/
public class DecimalToOctal {
/**
@ -13,6 +13,8 @@ public class DecimalToOctal {
*
* @param args Command line Arguments
*/
//enter in a decimal value to get Octal output
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n, k, d, s = 0, c = 0;

View File

@ -1,5 +1,7 @@
package Conversions;
//Hex [0-9],[A-F] -> Binary [0,1]
public class HexaDecimalToBinary {
private final int LONG_BITS = 8;
@ -9,7 +11,7 @@ public class HexaDecimalToBinary {
int conHex = Integer.parseInt(numHex, 16);
// Hex a Binary:
String binary = Integer.toBinaryString(conHex);
// Presentation:
// Output:
System.out.println(numHex + " = " + completeDigits(binary));
}

View File

@ -1,9 +1,29 @@
package Conversions;
/**
* Converting Integers into Roman Numerals
*
*('I', 1);
*('IV',4);
*('V', 5);
*('IV',9);
*('X', 10);
*('XL',40;
*('L', 50);
*('XC',90);
*('C', 100);
*('D', 500);
*('M', 1000);
*
*/
public class IntegerToRoman {
private static int[] allArabianRomanNumbers = new int[]{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
private static String[] allRomanNumbers = new String[]{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};
//Value must be > 0
public static String integerToRoman(int num) {
if (num <= 0) {
return "";

View File

@ -13,6 +13,7 @@ public class RomanToInteger {
put('D', 500);
put('M', 1000);
}};
//Roman Number = Roman Numerals
/**
* This function convert Roman number into Integer