Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class Ex14_Tester here.
- *
- * @author (dror)
- * @version (a version number or a date)
- */
- import java.util.Random;
- import java.util.Scanner;
- public class Ex14_Tester_All
- {
- /* Set private variables to confige the simulation */
- //choose testers: "true" for tester to run
- private static boolean TESTER_0 = true; // The students tester
- private static boolean TESTER_1 = true; // Tester for question-1
- private static boolean TESTER_2 = true; // Tester for question-2
- private static boolean TESTER_3 = true; // Tester for question-3
- private static boolean TESTER_4 = true; // Tester for question-4
- //set printouts for the testers (not including the students tester)
- private static boolean printouts_1 = true;
- private static boolean printouts_2 = true;
- private static boolean printouts_3 = true;
- private static boolean printouts_4 = true;
- //set LOOPS for each tester (only for tesetrs 1-4)
- private static int LOOP_TESTER_1 = 1000;
- private static int LOOP_TESTER_2 = 1000;
- private static int LOOP_TESTER_3 = 1000;
- private static int LOOP_TESTER_4 = 1000;
- /* End of configure section */
- private static int f (int[]a, int low, int high)
- {
- int res = 0;
- for (int i=low; i<=high; i++)
- res += a[i];
- return res;
- }
- public static int what_org (int []a)
- {
- int temp = 0;
- for (int i=0; i<a.length; i++)
- {
- for (int j=i; j<a.length; j++)
- {
- int c = f(a, i, j);
- if (c%3 == 0)
- {
- if (j-i+1 > temp)
- temp = j-i+1;
- }
- }
- }
- return temp;
- }//End Original what
- /* seroDistanceItr
- * An Iterative method to calculate distance of '1' from nearest '0' in a[]
- */
- public static int[] zeroDistanceItr(int []bin_array){
- //Create a new int[] array to contain the distances of '1' from '0' in bin_array[]
- int[] distances_array = new int[bin_array.length];
- //Parse from left to right.
- //When encounter the first zero, start to calculate + write cells with the distance.
- //0 are not effected
- int zero_indx = -1; //zero isn't found yet
- int distance = -1; //initial value for distance. need to be positive
- int zero_counter = 0; //counts number of '0'
- for(int i=0; i< bin_array.length; i++){
- //if encounter a cell with '0':
- if( bin_array[i] == 0){
- distances_array[i] = 0;// '0' remains
- zero_indx = i;
- zero_counter++;
- }
- //calculate the distance and replace '1' with the value of distance
- else if( bin_array[i] != 0){//should have a distance instead of 1
- distance = i-zero_indx; //calculate distance from the last zero encountered
- distances_array[i] = distance;
- }
- }
- //Parse bin_array[] from right to left.
- //replace the distance only after first zero is encountered from left.
- //Also, replace the distanc eonly if distance is smaller than th ewritten distance.
- zero_indx = -1; //initiate zero_indx before parsing from left to right
- distance = -1; //initial value for distance. need to be positive
- for(int i=bin_array.length-1; i>=0; i--){
- //if encounter a cell with '0':
- if( bin_array[i] == 0){
- distances_array[i] = 0;// '0' remains
- zero_indx = i;
- zero_counter--;
- }
- //calculate the distance and replace '1' with the value of distance, if new distance is smaller than the written one
- else if( (bin_array[i] != 0)&&(zero_indx != -1) ){//calculate distance only after encountering the first zero from left
- distance = zero_indx - i; //calculate distance from the last zero encountered (zero is on the left)
- //only if last zero is still ahead (when parsing left to right)
- if( (distance < distances_array[i])&&(zero_counter>0) ){//if no '0' ahead, the distance is
- distances_array[i] = distance;
- }
- //if no more zero's ahead (when parsing left to right)--> write the distance
- else if(zero_counter == 0){
- distances_array[i] = distance;
- }
- }
- }
- return distances_array;
- }//End zeroDistanceItr
- /*
- * private method to find iteratively if a string t is a transtormation of string s
- */
- private static boolean isTransItr(String s, String t)
- {
- int s_pt = 0; //pointer starts to check at indx 0
- int t_pt = 0; //pointer starts to check at indx 0
- if( s.equals("") && t.equals("")){
- return true;
- }
- else if( s.equals("") || t.equals("")){
- return false;
- }
- //compare the first character of the two strings
- else if( s.length() > t.length()){
- return false;
- }
- //continue to compare the two strings from second character
- while( (s_pt < s.length())&&(t_pt < t.length())){
- if( s.charAt(s_pt) == t.charAt(t_pt) ){
- s_pt++;
- t_pt++;
- }
- else if( s.charAt(s_pt) != t.charAt(t_pt) ){
- if(t_pt==0){//The first character
- return false;
- }
- //character at t is duplicated
- else if(t.charAt(t_pt) == t.charAt(t_pt-1)){
- t_pt++;
- }
- //not a duplication issue
- else{
- return false;
- }
- }
- }
- //Not all characters in s have a match it t
- if(s_pt < s.length()){
- return false;
- }
- //comparison passed
- return true;
- }//End isTransItr
- //printouts for isTransItr
- private static void printOuts(int i, String s, String t, boolean expected, boolean result)
- {
- System.out.printf("%d)s= [", i);
- for (int u = 0; u < s.length(); u++){
- System.out.printf("%c ",s.charAt(u));
- }
- System.out.printf("]\n");
- System.out.printf(" %d)t= [", i);
- for (int w = 0; w < t.length(); w++){
- System.out.printf("%c ",t.charAt(w));
- }
- System.out.printf("]\n");
- if(expected != result){
- System.out.printf(" Failed: expected : %b, actual: %b\n\n ",expected,result);
- }
- else{ //expected == result
- System.out.printf(" Passed: expected : %b, actual: %b\n\n ",expected,result);
- }
- }//End printOuts for isTransItr (Tester-3)
- //printouts for tester-2
- private static void printDistance(int j, int[] a, int[] bin_array, int[] distances_array,boolean return_value)
- {
- System.out.printf("%d)a= [", j);
- for (int u = 0; u < a.length; u++){
- System.out.printf("%d ",a[u]);
- }
- System.out.printf("]\n");
- System.out.printf(" %d)expected distance= [", j);
- for (int w = 0; w < distances_array.length; w++){
- System.out.printf("%d ",distances_array[w]);
- }
- System.out.printf("]\n");
- System.out.printf(" %d)Actual distance= [", j);
- for (int w = 0; w < bin_array.length; w++){
- System.out.printf("%d ",bin_array[w]);
- }
- System.out.printf("]\n");
- if( return_value == true){ //expected == result
- System.out.printf(" Passed: expected is like actual\n\n ");
- }
- else if( return_value == false){ //expected != result
- System.out.printf(" Failed: expected is different actual\n\n ");
- }
- }//End printOuts for zeroDistance (Tester-2)
- private static boolean matchWithLoop (int[] a, int[] p)
- {
- int a_len = a.length;
- int p_len = p.length;
- boolean found_match = false;
- //no p --> return true
- if(p == null){
- return true;
- }
- //a < p --> return false
- else if(a.length < p.length){
- return false;
- }
- //Iterate a[] with pattern
- for(int i=0; i< a_len - p_len + 1; i++){
- if(found_match == true){
- return true;
- }
- else{//set to true for the inner loop
- found_match = true;
- }
- for (int j=0; (j< p_len)&&found_match; j++){
- int reminder = a[i+j]/10;
- reminder = (reminder < 0) ? -1*reminder : reminder;
- if(reminder >= 10){//three digits or more
- found_match=false;
- }
- else if(reminder >= 1){ // two digits
- if(p[j]==2 || p[j]==0){
- found_match = true;
- }
- else{ //p[j] == 1
- found_match = false;
- }
- }
- else if(reminder < 1){ //single digit
- if(p[j]==1 || p[j]==0){
- found_match = true;
- }
- else{//p[j] == 2
- found_match = false;
- }
- }
- }
- }
- return found_match; //for the case that a.len == p.len
- }//End Iterative match
- public static boolean TesterForStudents ()
- {
- int res, n;
- boolean result;
- int[] a={1,2,3,4};
- Scanner scan=new Scanner(System.in);
- System.out.println("************************** Test what - Started ***************************");
- res=Ex14.what(a);
- System.out.println(res);
- System.out.println("************************** Test what - Finished **************************\n");
- System.out.println("******************** Test checkZeroDistance - Started ********************");
- Ex14.zeroDistance(a);
- System.out.println("******************* Test checkZeroDistance - Finished ********************\n");
- System.out.println("************************ Test isTrans - Started ***********************");
- result=Ex14.isTrans("abbcd","aabbccdd");
- System.out.println(result); //expected true
- if(result != true){
- return false;
- }
- result=Ex14.isTrans("abbcd","abcd");
- System.out.println(result); //expected false
- if(result != false){
- return false;
- }
- System.out.println("************************ Test isTrans - Finished ***********************\n");
- System.out.println("***************** Test match - Started ******************");
- int[] a1= {2,3,57}, a2= {1,0,2};// expected true
- result=Ex14.match(a1, a2);
- System.out.println(result);
- if(result != true){
- return false;
- }
- int[] b1= {2,3,573,4,324,35} , b2= { }; // expected true
- result=Ex14.match(b1, b2);
- System.out.println(result);
- if(result != true){
- return false;
- }
- int[] c1= {2,3} , c2= {1,0,2}; //expected false
- result=Ex14.match(c1, c2);
- System.out.println(result);
- if(result != false){
- return false;
- }
- System.out.println("****************** Test match - Finished *****************\n");
- return true;
- }//End Tester-0 (Tester for students)
- public static boolean tester_Q1_manual( boolean printouts_1, int LOOP_TESTER_1){
- boolean return_value = false;
- int [][]a = {
- {-2, 0, 0, 0, 3},
- {-16, 63, -43},
- {-1, 2, 3},
- {-1,0,4},
- {-1},
- {0,-1,0,-2,-5,-3,-2,-3,-5},
- {1, 0, 0, 3, 3, 3, 3},
- {2, 0, 5, 3, 3, 3, 3},
- {2, 0, 5, 3, 1, 3, 3},
- {0, 0, 2, 0, 0, 0, 0},
- {1, 0, 1, 0, 0, 1, 2},
- {-2, 0, 0, 0, 0, 0, 1},
- {-9, -36, 45, 20, 85, -8, -69, -56, 26, -96, -20 }
- };
- int j=0,k=0;
- for(j=0; j<a.length; j++){
- return_value = true;
- if(printouts_1){
- System.out.printf("%3d) [", j);
- for(k=0; k<a[j].length-1; k++){
- System.out.print( a[j][k]+", ");
- }
- System.out.printf("%d]\n",a[j][k]);
- }
- int expected = what_org(a[j]);
- int result = Ex14.what(a[j]);
- if( expected != result ){
- return_value = false;
- System.out.printf(" failed: expected-what: %d, actual-what: %d \n",expected, result);
- break;
- }
- else if(printouts_1){
- System.out.printf(" Passed: expected-what: %d, actual-what: %d \n",what_org(a[j]), Ex14.what(a[j]));
- }
- }
- return return_value;
- }//End tester-1 manual
- public static boolean tester_Q1_Automatic( boolean printouts_1, int LOOP_TESTER_1){
- //Tester-1: Start the automatic tests
- boolean return_value = false;
- int j;
- for (j=0; j < LOOP_TESTER_1;j++)
- {
- return_value = true;
- Random rand = new Random();
- int[] aa = new int[rand.nextInt(200)];
- for (int t = 0; t < aa.length; t++)
- {
- aa[t] = rand.nextInt(200) - 100;
- }
- int result = Ex14.what(aa);
- int expected = what_org(aa);
- if(expected != result){
- return_value = false;
- System.out.printf("failed: expected-what: %d, actual-what: %d \n",expected,result);
- System.out.println();
- break;
- }
- if(printouts_1){
- System.out.printf("%3d) [", j);
- for (int t = 0; t < aa.length; t++)
- {
- System.out.printf("%d ",aa[t]);
- }
- System.out.printf("]");
- System.out.printf("\n Passed: expected-what: %d, actual-what: %d\n ",expected,result);
- }
- }
- return return_value;
- }//End tester_Q1 Automatic
- public static boolean tester_Q2_manual( boolean printouts_2, int LOOP_TESTER_2){
- boolean return_value = false;
- int [][]aa = {
- {0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1 },
- {0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0},
- {0},
- {0, 1},
- {1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0},
- {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
- {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
- {1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1},
- {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0},
- {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1}
- };
- int j=0,k=0;
- for(j=0; j<aa.length; j++){
- return_value = true;//default value before test
- int[] a = new int[aa[j].length];
- //save the original binary - array
- for(k=0; k<aa[j].length; k++){
- a[k] = aa[j][k];
- }
- Ex14.zeroDistance(a);
- int[] distances_array = zeroDistanceItr(aa[j]);
- //Both arrays should have the same length
- if(distances_array.length != a.length){
- return_value = false;
- printDistance(j, a, aa[j], distances_array, return_value);
- }
- //compare the binarry arrays: expected_array and bin_array (modified by zeroDistance)
- for( k=0; k<a.length; k++){
- if (a[k] != distances_array[k]){
- return_value = false;
- printDistance( j,a, aa[j], distances_array, return_value);
- return return_value;
- }
- }
- //If need to print arrays
- if(printouts_2){
- printDistance(j, a, aa[j], distances_array, return_value);
- }
- }
- return return_value;
- }//End tester-2 manual
- public static boolean tester_Q2_Automatic( boolean printouts_2, int LOOP_TESTER_2){
- boolean return_value = false;
- int j;
- for (j=0; j < LOOP_TESTER_2;j++)
- {
- return_value = true;
- Random rand = new Random();
- int[] bin_array = new int[rand.nextInt(100)]; //A binarry 0 to 100 in length
- int[] a = new int[bin_array.length];
- int count_ones=0;
- for (int t = 0; t < bin_array.length; t++)
- {
- bin_array[t] = rand.nextInt(2); //set 0 or 1
- a[t] = bin_array[t]; //save the original binary - array
- if(a[t]==1){
- count_ones++;
- }
- }
- //check that '0' exists:
- if( (count_ones == bin_array.length)||(bin_array.length==0) ){ //all bin_array elements are '1'
- //loop again with the same j value
- j--;
- continue;
- }
- if( (count_ones == bin_array.length)||(bin_array.length==0)){ //all bin_array elements are '1'
- //loop again with the same j value
- printDistance(j,a, bin_array, bin_array, false);
- return false;
- }
- Ex14.zeroDistance(bin_array);
- int[] distances_array = zeroDistanceItr(bin_array);
- //Both arrays should have the same length
- if(distances_array.length != bin_array.length){
- return_value = false;
- printDistance(j,a, bin_array, distances_array, return_value);
- }
- //compare the binarry arrays: expected_array and bin_array (modified by zeroDistance)
- for( int k=0; k<bin_array.length; k++){
- if (bin_array[k] != distances_array[k]){
- return_value = false;
- printDistance( j,a, bin_array, distances_array, return_value);
- return return_value;
- }
- }
- //If need to print arrays
- if(printouts_2){
- printDistance(j, a, bin_array, distances_array, return_value);
- }
- }
- return return_value;
- }//End tester_Q2 Automatic
- public static boolean tester_Q3(boolean printouts, int LOOP_TESTER_3){
- int i;
- boolean return_value = false;
- for (i = 0; i < LOOP_TESTER_3; i++)
- {
- return_value = true; //set The tests result to be true, before testing
- Random r = new Random();
- String alphabet = "abcdefghijklmnopqrstuvwxyz";
- Random rand = new Random();
- char[] s_char = new char[rand.nextInt(15)];//define a[] length up to 15 characters
- char[] t1_char = new char[s_char.length];
- char[] t2_char = new char[11*s_char.length];
- char[] t3_char = new char[11*s_char.length];
- int indx_t2 = 0;
- int indx_t3 = 0;
- for( int j=0; j<s_char.length; j++){
- s_char[j] = alphabet.charAt(r.nextInt(alphabet.length()));
- t1_char[j] = s_char[j]; //t1 is a simple duplication of s
- int duplicate = rand.nextInt(10)+1;//define a duplication factor from 1 to 11;
- //duplicating t2
- for( int k=0; k< duplicate; k++){
- t2_char[indx_t2] = s_char[j]; //duplicate s[] characters, in order
- indx_t2++;
- }
- duplicate = rand.nextInt(10);//define a duplication factor from 0 to 10;
- //duplicating t3
- for( int k=0; k< duplicate; k++){
- t3_char[indx_t3] = s_char[j]; //duplicate s[] characters, in order
- indx_t3++;
- }
- }
- //create string s: copy s_char[] into s
- String s = new String(s_char);
- //Create t1[]: a simple duplication of s --> a transformation
- String t1 = new String(t1_char);
- //create t2[]: s with inner duplications --> a transformation
- char []t2_char_upd = new char[indx_t2];
- for(int k=0; k< indx_t2; k++){
- t2_char_upd[k] = t2_char[k];
- }
- String t2 = new String(t2_char_upd);
- //Create t3: based on t1, only may extends the inner character or leave it empty
- char []t3_char_upd = new char[indx_t3];
- for(int k=0; k< indx_t3; k++){
- t3_char_upd[k] = t3_char[k];
- }
- String t3 = new String(t3_char_upd);
- boolean result = Ex14.isTrans(s,t1);
- boolean expected = isTransItr(s,t1);
- boolean result_2 = Ex14.isTrans(s,t2);
- boolean expected_2 = isTransItr(s,t2);
- boolean result_3 = Ex14.isTrans(s,t3);
- boolean expected_3 = isTransItr(s,t3);
- //print strings
- if(printouts){
- printOuts(3*i+1,s,t1,expected, result);
- printOuts(3*i+2,s,t2, expected_2, result_2);
- printOuts(3*i+3,s,t3, expected_3, result_3);
- }
- //check expected-result
- if(expected != result){
- return_value = false; //found a failed test
- printOuts(3*i+1,s,t1, expected, result);
- System.out.println();
- break;
- }
- //check expected-result (2)
- else if(expected_2 != result_2){
- return_value = false; //found a failed test
- printOuts(3*i+2,s,t2, expected_2, result_2);
- System.out.println();
- break;
- }
- //check expected-result (3)
- else if(expected_3 != result_3){
- return_value = false; //found a failed test
- printOuts(3*i+3,s,t3, expected_3, result_3);
- System.out.println();
- break;
- }
- }
- return return_value;
- }//End tester_Q3
- public static boolean tester_Q4(boolean printouts, int LOOP_TESTER_4)
- {
- int i;
- boolean return_value = false;
- for (i = 0;i< LOOP_TESTER_4;i++)
- {
- return_value=true;//default value
- Random rand = new Random();
- int[] a = new int[rand.nextInt(15)];//define a[] length up to 200 elements
- int[] p = new int[rand.nextInt(5)];//define p[] length up to 20 elements
- for (int t = 0; t < a.length; t++)
- {
- a[t] = rand.nextInt(120); //set random numbers for a[]: -100 to 120
- }
- for(int s = 0; s < p.length; s++)
- {
- p[s] = rand.nextInt(3); //set random values: 0,1,2
- }
- boolean result = Ex14.match(a,p);
- boolean expected = matchWithLoop(a,p);
- if(printouts){
- System.out.printf("%d) [", i);
- for (int t = 0; t < a.length; t++)
- {
- System.out.printf("%d ",a[t]);
- }
- System.out.printf("]\n");
- System.out.printf(" %d) [", i);
- for (int s = 0; s < p.length; s++)
- {
- System.out.printf("%d ",p[s]);
- }
- System.out.printf("]\n");
- System.out.printf(" Passed: expected: %b, actual: %b\n\n ",expected,result);
- }
- if(expected != result){
- return_value = false;
- System.out.println("failed: expected: "+ expected + " Actual: "+ result );
- System.out.println();
- break;
- }
- }
- return return_value;
- }
- public static void main( String args[] ){
- /* No change below this line ! */
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /* No change below this line ! */
- boolean testerresult_0=false; // don't change !
- boolean testerresult_1_man=false; // don't change !
- boolean testerresult_1_Auto=false; // don't change !
- boolean testerresult_2_man=false; // don't change
- boolean testerresult_2_Auto=false; // don't change
- boolean testerresult_3=false; // don't change !
- boolean testerresult_4=false; // don't change !
- if(TESTER_0)
- {
- System.out.printf("\n\n\ntester-0\n");
- testerresult_0 = TesterForStudents();
- }
- if(TESTER_1)
- {
- if(printouts_1 == true){
- System.out.printf("\n\n\ntester-1 manual\n");
- }
- testerresult_1_man = tester_Q1_manual(printouts_1,LOOP_TESTER_1);
- if(printouts_1 == true){
- System.out.printf("\n\n\ntester-1 Automatic\n");
- }
- testerresult_1_Auto = tester_Q1_Automatic(printouts_1,LOOP_TESTER_1);
- }
- if(TESTER_2)
- {
- if(printouts_2 == true){
- System.out.printf("\n\n\ntester-2 \n");
- }
- testerresult_2_man = tester_Q2_manual(printouts_2,LOOP_TESTER_2);
- if(printouts_2 == true){
- System.out.printf("\n\n\ntester-2 Automatic\n");
- }
- testerresult_2_Auto = tester_Q2_Automatic(printouts_2,LOOP_TESTER_2);
- }
- if(TESTER_3)
- {
- if(printouts_3 == true){
- System.out.printf("\n\n\ntester-3 \n");
- }
- testerresult_3 = tester_Q3(printouts_3,LOOP_TESTER_3);
- }
- if(TESTER_4)
- {
- if(printouts_4 == true){
- System.out.printf("\n\n\ntester-4 \n");
- }
- testerresult_4 = tester_Q4(printouts_4,LOOP_TESTER_4);
- }
- //Results
- System.out.printf("\n\n\n");
- if(TESTER_0)
- {
- if( testerresult_0 == true ){
- System.out.printf("Students-Tester: ON, Passed \n");
- }
- else if( testerresult_0 == false ){
- System.out.printf("Students-Tester: ON, Failed \n");
- }
- }
- else if(TESTER_0 == false){
- System.out.printf("Students-Tester: OFF\n");
- }
- if(TESTER_1)
- {
- if( printouts_1 ){
- System.out.printf("Tester-1: printouts ON, ");
- }
- else if( !printouts_1 ){
- System.out.printf("Tester-1: printouts OFF, ");
- }
- if( testerresult_1_man == true ){
- System.out.printf("Tester-1: ON, Manual arrays passed \n");
- }
- else if(testerresult_1_man == false){
- System.out.printf("Tester-1: ON, Manual arrays Failed\n");
- }
- if( printouts_1 ){
- System.out.printf("Tester-1: printouts ON, ");
- }
- else if( !printouts_1 ){
- System.out.printf("Tester-1: printouts OFF, ");
- }
- if( testerresult_1_Auto == true ){
- System.out.printf("Tester-1: ON, Automatic arrays passed \n");
- }
- else if(testerresult_1_Auto == false){
- System.out.printf("Tester-1: ON, Automatic arrays Failed\n");
- }
- }
- else if(TESTER_1 == false){
- System.out.printf("Tester-1: OFF\n");
- }
- if(TESTER_2)
- {
- if( printouts_2 ){
- System.out.printf("Tester-2: printouts ON, ");
- }
- else if( !printouts_2 ){
- System.out.printf("Tester-2: printouts OFF, ");
- }
- if( testerresult_2_man == true ){
- System.out.printf("Tester-2: ON, manual arrays passed \n");
- }
- else if(testerresult_2_man == false){
- System.out.printf("Tester-2: ON, manual arrays Failed\n");
- }
- if( printouts_2 ){
- System.out.printf("Tester-2: printouts ON, ");
- }
- else if( !printouts_2 ){
- System.out.printf("Tester-2: printouts OFF, ");
- }
- if( testerresult_2_Auto == true ){
- System.out.printf("Tester-2: ON, Automatic arrays passed \n");
- }
- else if(testerresult_2_Auto == false){
- System.out.printf("Tester-2: ON, Automatic arrays Failed\n");
- }
- }
- else if(TESTER_2 == false){
- System.out.printf("Tester-2 OFF\n");
- }
- if(TESTER_3)
- {
- if( printouts_3 ){
- System.out.printf("Tester-3: printouts ON, ");
- }
- else if( !printouts_3 ){
- System.out.printf("Tester-3: printouts OFF, ");
- }
- if( testerresult_3 == true ){
- System.out.printf("Tester-3: ON, Automatic strings passed \n");
- }
- else if(testerresult_3 == false){
- System.out.printf("Tester-3: ON, Automatic strings Failed\n");
- }
- }
- else if(TESTER_3 == false){
- System.out.printf("Tester-3 OFF\n");
- }
- if(TESTER_4)
- {
- if( printouts_4 ){
- System.out.printf("Tester-4: printouts ON, ");
- }
- else if( !printouts_4 ){
- System.out.printf("Tester-4: printouts OFF, ");
- }
- if( testerresult_4 == true ){
- System.out.printf("Tester-4: ON, Automatic arrays passed \n");
- }
- else if(testerresult_4 == false){
- System.out.printf("Tester-4: ON, Automatic arrays Failed match\n");
- }
- }
- else if(TESTER_4 == false){
- System.out.printf("Tester-4 OFF\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement