style: enable MultipleVariableDeclarations in checkstyle (#5175)

Co-authored-by: vaibhav <vaibhav.waghmare@techprescient.com>
This commit is contained in:
vaibhav9t1
2024-05-25 23:48:27 +05:30
committed by GitHub
parent 44ce6e7b0d
commit 9eaa2bb756
82 changed files with 299 additions and 121 deletions

View File

@ -27,7 +27,8 @@ public final class AnyBaseToAnyBase {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String n;
int b1, b2;
int b1;
int b2;
while (true) {
try {
System.out.print("Enter number: ");
@ -132,7 +133,8 @@ public final class AnyBaseToAnyBase {
// Declare variables: decimal value of n,
// character of base b1, character of base b2,
// and the string that will be returned.
int decimalValue = 0, charB2;
int decimalValue = 0;
int charB2;
char charB1;
String output = "";
// Go through every character of n

View File

@ -15,7 +15,9 @@ public final class AnytoAny {
int sn = scn.nextInt();
int sb = scn.nextInt();
int db = scn.nextInt();
int m = 1, dec = 0, dn = 0;
int m = 1;
int dec = 0;
int dn = 0;
while (sn != 0) {
dec = dec + (sn % 10) * m;
m *= sb;

View File

@ -10,7 +10,10 @@ final class BinaryToDecimal {
}
public static long binaryToDecimal(long binNum) {
long binCopy, d, s = 0, power = 0;
long binCopy;
long d;
long s = 0;
long power = 0;
binCopy = binNum;
while (binCopy != 0) {
d = binCopy % 10;

View File

@ -32,7 +32,8 @@ public final class BinaryToOctal {
*/
public static String convertBinaryToOctal(int binary) {
String octal = "";
int currBit = 0, j = 1;
int currBit = 0;
int j = 1;
while (binary != 0) {
int code3 = 0;
for (int i = 0; i < 3; i++) {

View File

@ -24,7 +24,10 @@ final class DecimalToBinary {
* conventional algorithm.
*/
public static void conventionalConversion() {
int n, b = 0, c = 0, d;
int n;
int b = 0;
int c = 0;
int d;
Scanner input = new Scanner(System.in);
System.out.printf("Conventional conversion.%n Enter the decimal number: ");
n = input.nextInt();
@ -42,7 +45,10 @@ final class DecimalToBinary {
* algorithm
*/
public static void bitwiseConversion() {
int n, b = 0, c = 0, d;
int n;
int b = 0;
int c = 0;
int d;
Scanner input = new Scanner(System.in);
System.out.printf("Bitwise conversion.%n Enter the decimal number: ");
n = input.nextInt();

View File

@ -18,7 +18,11 @@ public final class DecimalToOctal {
// 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;
int n;
int k;
int d;
int s = 0;
int c = 0;
System.out.print("Decimal number: ");
n = sc.nextInt();
k = n;

View File

@ -56,7 +56,8 @@ public final class HexToOct {
*/
public static void main(String[] args) {
String hexadecnum;
int decnum, octalnum;
int decnum;
int octalnum;
Scanner scan = new Scanner(System.in);
System.out.print("Enter Hexadecimal Number : ");