Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If this is done within the time limit, I am willing to give bonus points by post

ID: 3555996 • Letter: I

Question

If this is done within the time limit, I am willing to give bonus points by posting another question worth 1500 and giving you those points as well.

Create a set of JUnit test suites in NetBeans for the BaseConversion Class. The file for the BaseConversion is found at this link.

https://www.dropbox.com/s/jjc5tymn2axfb04/BaseToBaseClient.zip

The BaseConversion Class is part of a BaseToBase Calculator project.

The goal of the BaseToBase Calculator project is to create a four function calculator that will allow the user to:

The BaseConversion Class is already complete and your job is to test this class. In developing your tests:

You should NOT correct any defects surfaced

_______________________________________________________

What I would like in return is a dropbox file with:

Explanation / Answer

public class BaseConversion0 {

public void writebase0(int n) {
System.out.println("Enter writebase0, n = " + n);
if (n != 0) {
writebase1(n/8);
System.out.println("Printing: " + n%8);
}
System.out.println("Leave writebase0, n = " + n);
}

public void writebase1(int n) {
System.out.println("Enter writebase1, n = " + n);
if (n != 0) {
writebase2(n/8);
System.out.println("Printing: " + n%8);
}
System.out.println("Leave writebase1, n = " + n);
}

public void writebase2(int n) {
System.out.println("Enter writebase2, n = " + n);
if (n != 0) {
writebase3(n/8);
System.out.println("Printing: " + n%8);
}
System.out.println("Leave writebase2, n = " + n);
}

public void writebase3(int n) {
System.out.println("Enter writebase3, n = " + n);
if (n != 0) {
writebase0(9999); // not called
System.out.println("Printing: " + n%8);
}
System.out.println("Leave writebase3, n = " + n);
}

public static void main(String[] args) {
int n = 93;
BaseConversion0 baseConversion0 =
new BaseConversion0();
baseConversion0.writebase0(93);
System.out.println(" is the value of " + n +
" (base 8)");
}
}

With recursion


public class BaseConversion {

public void writebase(int n) {
System.out.println("Enter writebase, n = " + n);
if (n != 0) {
writebase(n/8);
System.out.println("Printing: " + n%8);
}
System.out.println("Leave writebase, n = " + n);
}


public static void main(String[] args) {
int n = 93;
BaseConversion baseConversion =
new BaseConversion();
baseConversion.writebase(n);
System.out.println(" is the value of " + n +
" (base 8)");
}
}