Wednesday, May 15, 2019

The Essay for the Fourth Degree Black Belt (Sa Dan)

ESSAY
(The Fourth-Degree Black-Belt)

Source: Adapted from Mu Han Total Martial Arts’ Website (2019)

     During learning and teaching Martial Arts, especially Tae Kwon Do (TKD), Mu Han Total Martial Arts requires all instructors and students to focus on three principal aspects, i.e., (a) Jeong, (b) Ki, (c) Shin with Joong Yong. To be an ideal martial artist, Mu Han recommends that students should keep in mind a good balance between these components in TKD. This essay will describe, discuss and apply them during a long-life journey of studying and practicing “the art of the feet and hands” (Henning, 2000).  
     In general, the first principal component Jeong means affection, attachment or goodwill (Chung, 2018). However, Jeong in TKD means a mind or mentality of a martial artist. This component emphasizes on the mental aspects of martial arts, concentration, and focus.  It may be seen as religion or meditation. He/she should keep a clear mind of respect, integrity, perseverance, self-control, and indomitable spirit inside and outside of the dojang. Mentality is one of the most indispensable principal aspects for a successful martial artist who commits to the martial arts clan.
      The second principal component Ki may be understood as key, stature, or rudder but at Mu Han it is defined as requirement, knowledge or technique. A good martial artist should see Ki as the forms, patterns or poomsae in a way of kicking and punching (Oh, 2017). This component focuses on a specific body parts such as hands, arms, legs, waist, head, and torso. The martial artists’ right stances, correct punches, good blocks, great kicks or combination of the techniques will make a great impact on the target. Also, a knowledge of agility, mobility, power, balance, flexibility, and endurance enhances a martial artist’ capability in sparring.      
    The third principal component Shin may be referred to names, places, or music, but in TKD Shin is body, physical conditions of the martial artists (Henning, 2000). This component pays attention to the requirements for testing, including 12 hand motion sets (6 offenses, 6 defenses), poomsaes, Mu Han kicks, and board breaking. All activities such as warm-up, sit-up, push-up, fast-paced movement, stretch, etc. that improve the body for better kicking and punching require a martial artist’s body strength. Martial artists need to be in top physical shape in order to perform their best (Oh, 2017).
     Three principal aspects (Jeong, Ki, Shin) coexist mutually and support each other. They are interacted and complement one to another. Jeong Ki Shin are usually combined and illustrated at three vertices of a triangle where Joong Yong is at the center in Figure 1 below:
        Figure 1: Relationship of Triangular Principal Components Jeong, Ki, Shin with Joong Yong.

    Dependent on flexibility, Joong Yong means a middle application or acknowledge outline that a martial artist uses three combined components Jeong, Ki, Shin in order to search for a standard or benchmark (Oh, 2017). He/she also applies them to measure high or low level of expectation. In other words, Joong Yong is an application of three essential principal aspects Jeong Ki Shin in a balanced manner. Joong Yong, located at the triangle center, connects bi-directionally to three principal aspects Jeong Ki Shin in triangulation (Oh, 2017). Notice that the red and yellow double arrows in Figure 1 indicate the mutual inter-connections between three essential aspects of Tae Kwon Do with Joong Yong.

       Figure 2: Joong Yong with Jeong, Ki, Shin at various levels in a typical training class.
                Source: Adapted from Master Oh Jin’s Instructor Seminar (June 27, 2017).

     In further discussion, it is instructors’ responsibility to keep in mind these principles and help students to maintain a balance between them throughout the Mu Han class. Joong Yong can be visualized at low/high levels of Jeong Ki Shin during the class. Notice that at the beginning of the class, Jeong is high where Ki and Shin at very low. And at the requirements practice, Jeong Ki Shin all are at a high level 6 as shown in Figure 2.       
     To apply the principal aspects Jeong, Ki, Shin with Joong Yong in training, teaching or practicing, a martial artist can use a common Mu Han framework in six Steps: (1) Goal Setting, (2) Motivation, (3) Patience, (4) Discipline, (5) Achievement, and (6) Happiness. Especially Step (4) Discipline includes confidence, respect, focus, concentration, self- esteem. This fundamental six-step cycle, as shown in Figure 3, can be repeated by students, assistant instructors or instructors to find their personal path along with Jeong, Ki, Shin and Joong Yong to improvement and success.
Figure 3: Fundamental Mu Han framework for improvement.
     In conclusion, the fundamental concept of three principal aspects of Jeong, Ki, Shin with central Joong Yong was explained and discussed explicitly in this essay. Their mutual relationship was described and widened to the Mu Han foundational framework. The application of acknowledging outline to find standard and apply high or low on mentality, requirement or technique, and physical condition is the critical key of improvement and success for each individual student. As a student and instructor at Mu Han, I always apply these principles during practicing or teaching other fellow students in sportsmanship and Mu Han spirit.     


REFERENCES

Chung, C. (2018). What is Jeong? Retrieved by May, 2919 from  http://www.prcp.org/publications/sig.pdf

Henning, S. (2000). Traditional Korean martial arts. Journal of Asian Martial Arts. Retrieved by May, 2919 from http://www.martialartsresource.com/korean/TKD.list.htm

Oh, J. (2017). Mu Han Total Martial Arts: Curriculum. Seminar of instructors and assistant instructors in June 2017.

Syed, S. (2017). The five foundations of Taekwondo. Retrieved by May 2019 from 
           https://www.hercampus.com/school/old-westbury/five-foundations-taekwondo.



Monday, May 13, 2019

Java Programming: Grade Book

/* Java program: Grade Book by PTL.
   Version 007 - 01 November, 2018.

   This Java program will allow an authorized user to enter student names and test
   scores. It will calculate and display 4 test scores, min, max, average, and test grades, final grade,
   and also number of A, B, C...  for each student. It also calculates min,max, test average and
   number of grades (A, B, C,..) for each test.

DESIGN:
   Use 4 arrays : names[] to store the student names
                  table[][] to store 4 test scores, min max avarage for each student
                  grades[][] to store the grades of 4 tests for students
                  count[][] to store numbers of students graddes and test grades
   Define the class Table with constructor Table() to initialize some variables.
   This class also defines many methods to calculate min, max, averages, and numbers of A, B, C,...

Note: The program is applied for 3 students and 4 tests but it can be expanded for many test and students
      by changing the indice of the arrays and the print-out messages.
*/
package gradebookmk2ple;
import java.util.Scanner;
/* Table class provides all methods to calculate Min, Max, Averages, Grades, and
   numbers of the Grades for each student and also for each test
*/
class Table
{
    int i, j, k;
    int idx1 = 6, idx2 = 7;
    int cntA, cntB, cntC, cntD, cntF;

    double sum, classAve, testAve;
    double min, max;
    double scoresNum, studNum;
   
    Table() // Use constructor to initialize some variables
    {
        cntA = 0;
        cntB = 0;
        cntC = 0;
        cntD = 0;
        cntF = 0;
        scoresNum = 4;
        studNum = 3;
    }
       
    char grades[][]    = new char[3][5];     // Store the student grades
    String names[]     = new String[3];      // Store student names
    int count[][]      = new int[5][9];      // Store number of grades (A, B, C, D, or F) of students and the tests
    double table[][]   = new double[idx1][idx2];  // Array stores test scores, min, max, ave.
    double studTbl[][] = new double[3][5];   // Array stores sorted numerical ordered scores for student medians
    double tstTbl[][]  = new double[4][4];   // Array stores sorted numerical ordered scores for test medians
    Scanner scan = new Scanner(System.in);   // Input data from console, keyborad.
   
    void enterName()    // Input student names
    {
        for (i = 0; i < 3; i++)
        {
            System.out.println("ENTER STUDENT NAME " + (i+1));
            names[i] = scan.next();
        } 
    }
   
    void compuScores()  // Input test scores and calculate the average for each student
    {
       sum = 0;
       for (i = 0; i < (idx1-3); i++)
       {
           System.out.println("ENTER SCORES FOR STUDENT " + (i+1));
           for (j = 0; j < (idx2-3); j++)
           {
               table[i][j] = scan.nextDouble();
               sum = sum + table[i][j];      // Get sum of scores for each student
           }
           table[i][6] = sum / scoresNum;       // Store Average of each student
           sum = 0;                             // Reset sum for next student
           //System.out.println(" Sum = " + sum + " Average = " + table[i][6]);
       } 
    }

    void compuStudentMinMax()   // Calculate min (low), max (high) scores for each student
    {
       for (i = 0; i < (idx1-3); i++)
       {
           min = max = table[i][0];     // Init min, max
           for (j = 0; j < (idx2-3); j++)
           {
               if (table[i][j] < min)
                   min = table[i][j];
               if (table[i][j] > max)
                   max = table[i][j];
           }
           table[i][4] = min;
           table[i][5] = max;
           //System.out.println("min = " + table[i][3] + " max = " + table[i][4]);
       }
    }
   
    void compuTestMinMax()  // Calcualate min (low), max (high) of each test
    {
       for (j = 0; j < (idx2-3); j++)
       {
           min = max = table[0][j];     // Init min, max
           for (i = 0; i < (idx1-3); i++)
           {
               if (table[i][j] < min)
                   min = table[i][j];
               if (table[i][j] > max)
                   max = table[i][j];
           }
           table[3][j] = min;
           table[4][j] = max;
           //System.out.println("min = " + table[i][3] + " max = " + table[i][4]);
       }
    } 
   
    void compuGrade()   // Calculate the grades of students
    {
       for (i = 0; i < (idx1-3); i++)
       {    // Final grade for each student
            if (table[i][6] > 89.5)  grades[i][4] = 'A';
            else if ((table[i][6] >= 79.5) & (table[i][6] < 89.5))  grades[i][4] = 'B';
            else if ((table[i][6] >= 69.5) & (table[i][6] < 79.5))  grades[i][4] = 'C';
            else if ((table[i][6] >= 59.5) & (table[i][6] < 69.5))  grades[i][4] = 'D';
            else grades[i][4] = 'F';
       }   
           
       for (i = 0; i < (idx1-3); i++)
       {    // Test grades and humber of grades (A, B,..) for each student
           for (j = 0; j < (idx2-3); j++)
           {
                if (table[i][j] > 89.5) 
                {
                    grades[i][j] = 'A';
                    cntA++;
                    count[i][0] = cntA;
                }
                else if ((table[i][j] >= 79.5) & (table[i][j] < 89.5)) 
                {
                    grades[i][j] = 'B';
                    cntB++;
                    count[i][1] = cntB;
                }
                else if ((table[i][j] >= 69.5) & (table[i][j] < 79.5))
                {
                    grades[i][j] = 'C';
                    cntC++;
                    count[i][2] = cntC;
                }
                else if ((table[i][j] >= 59.5) & (table[i][j] < 69.5)) 
                {
                    grades[i][j] = 'D';
                    cntD++;
                    count[i][3] = cntD;
                }
                else
                {
                    grades[i][j] = 'F';
                    cntF++;
                    count[i][4] = cntF;
                }     
           }
           cntA = cntB = cntC = cntD = cntF = 0;
       }
     
       for (j = 0; j < (idx2-3); j++)
       {    // Number of grades (A, B,..) on each test
           for (i = 0; i < (idx1-3); i++)
           {    // Note: Can use the Switch staement here if time allows.
//                if (grades[i][j] == 'A')      // Use if else ladder
//                {
//                    cntA++;
//                    count[0][j+5] = cntA;
//                }
//                else if (grades[i][j] == 'B')
//                {
//                    cntB++;
//                    count[1][j+5] = cntB;
//                }
//                else if (grades[i][j] == 'C')
//                {
//                    cntC++;
//                    count[2][j+5] = cntC;
//                }
//                else if (grades[i][j] == 'D') 
//                {
//                    cntD++;
//                    count[3][j+5] = cntD;
//                }
//                else
//                {
//                    cntF++;
//                    count[4][j+5] = cntF;
//                }   
                  switch (grades[i][j])     // Use Switch statement
                  {
                      case 'A':
                        cntA++;
                        count[0][j+5] = cntA;
                        break;
                      case 'B':
                        cntB++;
                        count[1][j+5] = cntB;
                        break;
                      case 'C':
                        cntC++;
                        count[2][j+5] = cntC;
                        break;                       
                      case 'D':
                        cntD++;
                        count[3][j+5] = cntD;
                        break;                       
                      case 'F':
                        cntF++;
                        count[4][j+5] = cntF;
                        break; 
                      default:
                        break; 
                  }
           }
           cntA = cntB = cntC = cntD = cntF = 0;
       }
    }
   
    double compuTestAverage()   // Calculate Average of each test
    {
        for (j = 0; j < (idx2-3); j++)
        {
            testAve = 0;
            for (i = 0; i < (idx1-3); i++)
                testAve = testAve + table[i][j];
           
            testAve = testAve / studNum;
            table[5][j] = testAve;
            testAve = 0;
        }
        return testAve;
    }
   
    double compuClassAverage()  // Calcukate the average of the entire class
    {
        classAve = 0;
        for (i = 0; i < (idx1-2); i++)
        {
            classAve = classAve + table[i][6];
        }
        classAve = classAve / studNum;
        return classAve;
    }
   
    void compuStudentMedian()
    {
        double temp;
        // Copy all scores from table[3][4] to studTbl[3][4]
        for (i = 0; i < (idx1-3); i++)
        {
            for (j = 0; j < (idx2-3); j++)
            {
                studTbl[i][j] = table[i][j];
            }
        }
       
        // Ascending buble sorting
        for (i = 0; i < (idx1-3); i++)
        { 
            for (j = 0; j < (idx2-3); j++)
            {
                for (k = (j+1); k < (idx2-3); k++)
                {
                    if (studTbl[i][j] > studTbl[i][k])
                    {
                        temp = studTbl[i][j];
                        studTbl[i][j] = studTbl[i][k];
                        studTbl[i][k] = temp;
                    }
                }       
            }
            studTbl[i][4] = (studTbl[i][1] + studTbl[i][2]) / 2;
            //System.out.println("studTbl[i][1]=" + studTbl[i][1] + " studTbl[i][2]=" + studTbl[i][2]);
       }       
    }
   
    void compuTestMedian()
    {
        double temp;
        // Copy all scores from table[3][4] to tstTbl[3][4]
        for (i = 0; i < (idx1-3); i++)
        {
            for (j = 0; j < (idx2-3); j++)
            {
                tstTbl[i][j] = table[i][j];
            }
        }
       
        // Ascending buble sorting for test medians
        for (j = 0; j < (idx2-3); j++)
        { 
            for (i = 0; i < (idx1-3); i++)
            {
                for (k = (i+1); k < (idx1-3); k++)
                {
                    if (tstTbl[i][j] > tstTbl[k][j])
                    {
                        temp = tstTbl[i][j];
                        tstTbl[i][j] = tstTbl[k][j];
                        tstTbl[k][j] = temp;
                    }
                }       
            }
            tstTbl[3][j] = tstTbl[1][j];  // test median values.
            //System.out.println("studTbl[i][1]=" + studTbl[i][1] + " studTbl[i][2]=" + studTbl[i][2]);
       }       
    }
}

public class Gradebookmk2ple
{
    public static void main(String[] args)
    {   /* The main method just calls class methods to display student names, test scores and obtain students'
        min, max, averages, test grades, numbers of grades (A, B, C, D, or F).
        It also calculates min, max, test average and number of grades for each test.*/
       
        int i, j;
        double classAverage;
        Table student = new Table();
       
        student.enterName();
        student.compuScores();
        student.compuStudentMinMax();
        student.compuTestMinMax();
        student.compuGrade();
        student.compuTestAverage();
        student.compuStudentMedian();
        student.compuTestMedian();
        classAverage  = student.compuClassAverage();
       
        System.out.println("\t");
        System.out.println("TABLE OF TEST RESULTS");
        // System.out.println("Students  " + "Test1\t" + "Grade1\t" + "Test2\t" + "Grade2\t" + "Test3\t" + "Grade3\t" + "Test4\t" + "Grade4\t" + "Min\t" + "Max\t" + "Final Averages\t" + "Final Grades\t" + "Number of A\t" + "Number of B\t" +"Number of C\t" +"Number of D\t" +"Number of F\t");
        //System.out.println("Students  " + "Test1  " + "Grade1\t" + "Test2\t" + "Grade2\t" + "Test3\t" + "Grade3\t" + "Test4\t" + "Grade4\t" + "Final Grades");     
        System.out.println("Students  " + "Test1  " + "Test2\t" + "Test3\t" + "Test4\t" + "Average\t" + "Median\t" + "High\t" + "Low\t" + "A\t" + "B\t" + "C\t" + "D\t" + "F\t");     
       
        for (i = 0; i < (student.idx1-3); i++)
        { 
             //System.out.print(student.names[i] + "\t" + student.table[i][0] + "\t" + student.grades[i][0]+ "\t" + student.table[i][1] + "\t" + student.grades[i][1]+ "\t" + student.table[i][2] + "\t" + student.grades[i][2]+ "\t" + student.table[i][3] + "\t" + student.grades[i][3]+ "\t" + student.table[i][4] + "\t" + student.table[i][5] + "\t" + student.table[i][6] + "\t\t" + student.grades[i][4]);
             //System.out.println("\t\t" + student.count[i][0] + "\t\t" + student.count[i][1] + "\t\t" + student.count[i][2] + "\t\t" + student.count[i][3] + "\t\t" + student.count[i][4]);
             //System.out.println(student.names[i] + "\t  " + student.table[i][0] + "\t " + student.grades[i][0]+ "\t" + student.table[i][1] + "\t" + student.grades[i][1]+ "\t" + student.table[i][2] + "\t" + student.grades[i][2]+ "\t" + student.table[i][3] + "\t" + student.grades[i][3]+ "\t" + student.grades[i][4]);
             //System.out.println("\t  " + "Min = " + student.table[i][4] + ",  Max = " + student.table[i][5] + ",  Final Average = " + student.table[i][6]);
             //System.out.println("\t  " + "Number of A = " + student.count[i][0] + ", Number of B = " + student.count[i][1] + ", Number of C = " + student.count[i][2] + ", Number of D = " + student.count[i][3] + ", Number of F = " + student.count[i][4]);
             System.out.println(student.names[i] + "\t  " + student.table[i][0] + "\t " + student.table[i][1] + "\t" + student.table[i][2] + "\t" + student.table[i][3] + "\t" + student.table[i][6]+ "\t" + student.studTbl[i][4] + "\t" + student.table[i][5] + "\t" + student.table[i][4] + "\t" + student.count[i][0] + "\t" + student.count[i][1] + "\t" + student.count[i][2]+ "\t" + student.count[i][3]+ "\t" + student.count[i][4]);
        }
       
        //System.out.println("  ");
        //System.out.println("studTbl[0][0]=" + student.studTbl[0][0] + " studTbl[0][1]=" + student.studTbl[0][1]);
        //System.out.println("studTbl[0][2]=" + student.studTbl[0][2] + " studTbl[0][3]=" + student.studTbl[0][3]);
        //System.out.println("table[0][1]=" + student.table[0][1] + " table[0][2]=" + student.table[0][2]);
        //System.out.println("median studTbl[0][4]=" + student.studTbl[0][4]);
       
        //System.out.println();
        //for (i=0; i<3; i++) // List content of studTbl[3][4]
        //{
        //    for (j=0; j<4; j++)
        //    {
        //        System.out.print(student.studTbl[i][j] + ",");
        //    }
        //    System.out.println();
        //}
       
        System.out.println();
        System.out.print("Average\t");
        for (j = 0; j < (student.idx2-3); j++)
        {
            //System.out.println(" Test" + (j+1) + "  Min = " + student.table[3][j] + ", Max = " + student.table[4][j] + ", Test Average = " + student.table[5][j]);
            //System.out.println("\t"  + "Number of A = " + student.count[0][j+5] + ", Number of B = " + student.count[1][j+5] + ", Number of C = " + student.count[2][j+5] + ", Number of D = " + student.count[3][j+5] + ", Number of F = " + student.count[4][j+5]);
            System.out.print("  " + student.table[5][j] + "\t");
        }
        System.out.println("  ");
       
        System.out.print("Median\t");
        for (j = 0; j < (student.idx2-3); j++)
        {
            System.out.print("  " + student.tstTbl[3][j] + "\t");
        }
        System.out.println("  ");
       
        System.out.print("High\t");
        for (j = 0; j < (student.idx2-3); j++)
        {
            System.out.print("  " + student.table[4][j] + "\t");
        }
        System.out.println("  ");
       
        System.out.print("Low\t");
        for (j = 0; j < (student.idx2-3); j++)
        {
            System.out.print("  " + student.table[3][j] + "\t");
        }
        System.out.println("  ");
       
        System.out.print("A's\t  ");
        for (j = 5; j < (student.idx2+2); j++)     
            System.out.print( + student.count[0][j] + "\t  ");
        System.out.println();   
       
        System.out.print("B's\t  ");
        for (j = 5; j < (student.idx2+2); j++)     
            System.out.print(student.count[1][j] + "\t  ");
        System.out.println();
       
        System.out.print("C's\t  ");
        for (j = 5; j < (student.idx2+2); j++)     
            System.out.print(student.count[2][j] + "\t  ");
        System.out.println();
       
        System.out.print("D's\t  ");
        for (j = 5; j < (student.idx2+2); j++)     
            System.out.print(student.count[3][j] + "\t  ");
        System.out.println();
       
        System.out.print("F's\t  ");
        for (j = 5; j < (student.idx2+2); j++)     
            System.out.print(student.count[4][j] + "\t  ");
        System.out.println();
       
        System.out.println(" Class Average = " + classAverage);
    }
}

The Essay for the Third Degree Black Belt (Sam Dan)


     My name is TSL, an EE Dan (Second Degree Black Belt) student and instructor at Mu Han Total Martial Arts.
     After many years in training at Mu Han, I, as a regular student, leadership student, assistant instructor and instructor have learned and practiced Martial Arts, particularly Tae Kwon Do (TKD), Kung Fu, Sip Pal Ki, Professional TKD, Weapons (sword, staff) and Yoga. Under the enlightening guidance from Head Master Oh, Grand Master Kang, Master Lee, and others. Mu Han offers the unique structural triangle of 3 essentially interactive factors at its vertices (a) Jeong - Mentality/ Mind, (b) Ki – Technique/Requirement/Knowledge, and (c) Shin - Body/Physical Condition with Joong Yong or martial artist’s Middle Use at the center.
     In teaching and training, Mu Han Total Martial Arts bases on 4 elements: (1) Ki Bon (Basic), (2) Ki Cho (Basic Foundations), (3) Ki Bon Dong Jak (Basic Motions), and (4) Technique. This essay will explain and discuss these elements in details below:
     1. Ki Bon is a basic which consists of left hand, right hand, left leg, and right leg. Later, it adds 2 more basics: human head and body (torso). So, a martial artist as a human being has 6 basics: 2 hands, 2 legs, head, and body.
     2. Ki Cho is basic foundations. They are basic stances, blocks, kicks, punches, etc. For basic stances include walking stance (Ap seogi), running stance (Ap kubi), back stance (Dwit kubi), tiger stance (Beom Seogi), side stance, cross stance, riding stance (Juchum Seogi), and others. On the blocks, there are low block (Ahre Maggi), middle block (Mom Tong Maggi), high block (Elgol Maggi), inner block, outer block (Pakuro Maggi), etc.   
     3. Ki Bon Dong Jak is the basic motions. In Mu Han, a basic motion focuses on a single purpose. It has power from a big circle. Its adaptability bases on time, distance, direction, situation, environment or space. A basic motion must match with logic of Youk Hap. For example, one of the basic motions for a beginner is “10 Motions” that include ki cho such as attention (chariot), riding stance (juchum seogi), ready stance (chumbi), punch, bow (kyong-ye). They also consist of Six Offenses, and Six Defenses.
     4. Technique is the forms, patterns or poomsae. In traditional martial arts, there are 18 techniques. Later, great grand masters/founders add 6 more techniques such as bow, arrows, horse riding. Therefore, modern martial arts have 24 techniques. Technique comprises (a) physical technique and (b) strategy (mental technique):
          a. Physical technique: To make a strategy successful, one or more basic motions are combined together. For example, a martial artist’s left hand block on an opponent’s punch is followed by his back turn for a right elbow on the opponent’s face/jaw, then the martial artist’s front turn to deliver a roundhouse kick to the opponent’s belly. A combination of basic motions intends to make an opponent confuse and unpredictable.
          b. Strategy is a mental technique which a martial artist can use to offense, defense, counter-attack, protect, disable effectively the opponents. A martial artist can use strategy on the motions at really quick momentum/inertia, actual action with great impact or strong delivery.
     In conclusion, Mu Han Total Martial Arts describes Ki Bon, Ki Cho, Ki Bon Dong Jak, and Technique explicitly in training and teaching to students. Head Master Oh has often explained these terms verbally and manually to instructors and assistant instructors in both Instructor classes and Master classes. As a student and instructor at Mu Han, I always apply these basics as much as I can during practicing or teaching other fellow students in sportsmanship and Mu Han spirit.  

Sunday, May 12, 2019

Java Programming: Sorting an array


// Note: Java program is built on NetBeans IDE 8.2.   OS Windows 8 or Windows 10.
//          This is a sample of the simple programming in Java for beginners.
//------------------------------------------------------------------------------------------------------

package sortarrayple;

import java.util.Scanner;
import java.util.Arrays;

class data
{
    Scanner input = new Scanner(System.in);
    
    int i;
    int j = 5;
    int k;
    
    final int num[] = new int[j]; //original values
    int BUB[] = new int [j]; //for BUBLhightolow
    int BUB2[] = new int [j]; //for BUBLlowtohigh
    int n[] = new int[j]; // for sortLOWTOHIGH
    int n2[] = new int[j]; //for sortHIGHTOLOW
    int ex[] = new int[j]; // for exeHIGHTOLOW
    int ex2[] = new int[j]; // for exeLOWTOHIGH
    
    void enterdata() // method to retrieve user data
    {
        for (i = 0; i < j; i++)
        {
            System.out.println("ENTER VALUE");
            num[i] = input.nextInt();
        }
    }
    
    void BUBLhightolow()
    {
        int temp;
        for (i = 0; i < j; i++)
        {
            BUB[i] = num[i];
        }
        
        for (i = 1; i < BUB.length; i++)
        {
            for (k = (BUB.length - 1); k >= i; k--)
            {
                if (BUB[k-1] < BUB[k]) //compares the the value of the 2 most adjacent loction and finds the highest. 
                {
                    temp = BUB[k-1];
                    BUB[k-1] = BUB[k];
                    BUB[k] = temp;
                }
            }
        }     
    }
    
    void BUBLlowtohigh()
    {
        int temp2;
        
        for (i = 0; i < j; i++)
        {
            BUB2[i] = num[i];
        }
        
        for (i = 1; i < BUB2.length; i++)
        {
            for (k = (BUB2.length - 1); k >= i; k--)
            {
                if (BUB2[k-1] > BUB2[k]) // compares the 2 most adjacent values to find the lowest
                {
                    temp2 = BUB2[k-1];
                    BUB2[k-1] = BUB2[k];
                    BUB2[k] = temp2;
                }
            }
        }
    }
    
    void sortLOWTOHIGH()
    {
        for (i = 0; i < j; i++)
        {
            n[i] = num[i];
        }
        Arrays.sort(n); //java util allows finds low to high
    }
    
    void sortHIGHTOLOW()
    {
        for (i = 0; i < j; i++)
        {
            n2[i] = num[i]*(-1); //if all values are multiplied by -1 then the values are reversed... the highest becomes lowest
            Arrays.sort(n2);
        }
        
        for (i = 0; i < j; i++)
        {
            n2[i] = n2[i]*(-1); // after sorting -1 is multiplied again so the highest will be the highest again
        }              
    }
    
    void exeHIGHTOLOW()
    {
        int temp3;
        for (i = 0; i < j; i++)
        {
            ex[i] = num[i];
        }
        
        for (i = 0; i < ex.length-1; i++)
        {
            for (k = (i +1); k < ex.length; k++) // compares the the first value in the for loop to the rest of the values
            {
                if (ex[i] < ex[k]) //returns the highest then the lowest 
                {
                    temp3 = ex[i];
                    ex[i] = ex[k];
                    ex[k] = temp3;
                }
            }
        }
    }
    
    void exeLOWTOHIGH()
    {
        int temp4;
        for (i = 0; i < j; i++)
        {
            ex2[i] = num[i];
        }
        
        for (i = 0; i < ex.length-1; i++)
        {
            for (k = (i +1); k < ex.length; k++)// compares the the first value in the for loop to the rest of the values
            {
                if (ex2[i] > ex2[k])//returns the lowest then the highest
                {
                    temp4 = ex2[i];
                    ex2[i] = ex2[k];
                    ex2[k] = temp4;
                }
            }
        }
    }
    
    void display(int tst, data b)
    {
        for (i = 0; i < j; i++)
        {
            switch (tst)
            {
                case 0:
                    System.out.print(b.num[i] + " ");
                    break;
                case 1:
                    System.out.print(b.BUB[i] + " ");
                    break;
                case 2:
                    System.out.print(b.BUB2[i] + " ");
                    break;
                case 3:
                    System.out.print(b.n2[i] + " ");
                    break;
                case 4:
                    System.out.print(b.n[i] + " ");
                    break;
                case 5:
                    System.out.print(b.ex[i] + " ");
                    break;
                case 6:
                    System.out.print(b.ex2[i] + " ");
                    break;    
            }
        }
        System.out.println();
    }
            
}

public class SortArrayple 
{   
    public static void main(String[] args) 
    {
        int i;
        data a = new data();
        
        a.enterdata();
        a.BUBLhightolow();
        a.BUBLlowtohigh();
        a.sortLOWTOHIGH();
        a.sortHIGHTOLOW();
        a.exeHIGHTOLOW();
        a.exeLOWTOHIGH();
        
        System.out.println();        
        System.out.print("ORIGINAL ORDER:         ");
//        for (i = 0; i < 5; i++)
//        {
//            System.out.print(a.num[i] + " ");
//        }
//        System.out.println();
          a.display(0, a);
          
        System.out.print("BUBBLE SORT (HItoLO):   ");
//        for (i = 0; i < 5; i++)
//        {
//            System.out.print(a.BUB[i] + " ");
//        }
//        System.out.println();
          a.display(1, a);
          
        System.out.print("BUBBLE SORT (LOtoHI):   ");
//        for (i = 0; i < 5; i++)
//        {
//            System.out.print(a.BUB2[i] + " ");
//        }
//        System.out.println();
          a.display(2, a);
          
        System.out.print("UTIL ASSORT (HItoLO):   ");        
//        for (i = 0; i < 5; i++)
//        {
//            System.out.print(a.n2[i] + " ");
//        }
//        System.out.println();
          a.display(3, a);
          
        System.out.print("UTIL ASSORT (LOtoHI):   ");        
//        for (i = 0; i < 5; i++)
//        {
//            System.out.print(a.n[i] + " ");
//        }
//        System.out.println();
          a.display(4, a);
        System.out.print("EXCHANGE SORT (HItoLO): ");        
//        for (i = 0; i < 5; i++)
//        {
//            System.out.print(a.ex[i] + " ");
//        }
//        System.out.println();
          a.display(5, a);
          
        System.out.print("EXCHANGE SORT (LOtoHI): ");
//        for (i = 0; i < 5; i++)
//        {
//            System.out.print(a.ex2[i] + " ");
//        }
          a.display(6, a);
    }
}





Java Programming: Display Prime Numbers [1-1000]


// Note: Java program is built on NetBeans IDE 8.2.   OS Windows 8 or Windows 10.
//          This is a sample of the simple programming in Java for beginners.
//--------------------------------------------------------------------------------------------------------

/*

 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package primenumbers1.pkg100;

/**
 *
 * @author TSL
 */
public class Primenumbers1100
{
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) 
    {
        // TODO code application logic here
        int i, j;
        int limit = 1000;
        boolean isPrime = true;
        System.out.println("Prime numbers 1 between and " + limit);
        for(i=1; i<limit; i++)
        {
            isPrime = true;
        
            for(j=2; j<i; j++)
            {
                if(i%j==0)
                {
                    isPrime = false;
                    break;
                }
            }
      
            if(isPrime)
                System.out.print(i + " ");
        }
    }
}



Java Program Code: Calculating Prime Numbers

// Note: Java program is built on NetBeans IDE 8.2.   OS Windows 8 or Windows 10.
//          This is a sample of the simple programming in Java for beginners.
//----------------------------------------------------------------------------------------------------------------

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package CalcPrime;
import java.util.Scanner;
/**
 *
 * @author  TSL
 */
class CalcPrim
{

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args){
        // TODO code application logic here Scanner Reader
        int i = 2;
        Scanner scan = new Scanner(System.in);
        Scanner user_input = new Scanner(System.in);
        System.out.println("ENTER VALUE");
        int n;
        n = scan.nextInt();
        while (i<= (n-1))
        {
            if (n % i == 0)
            {
                System.out.println("value is not a prime");
                        break;           
            }
            else
            {
                System.out.println("value is prime");
            }
        }
    }
}

Thursday, July 27, 2017

A Call for Participation in the Research Study

      
A Call for Participation in the Research Study

Note: A Call for participation in the Research Study was posted in Linkedin.com and
          Facebook on 7/24/2017.
URL: https://www.linkedin.com/pulse/call-participation-research-study-thiensi-le

The research topic:
            The standard strategies for establishing common pattern correlations from extracted data, information within Big Data.

The research problem:
Since the introduction of big data concepts, data sets are continually growing to contain meaningful information for widely varying contexts. However, these widely varying contexts limit the ability to correlate the information for predictive analysis because the strategies for establishing common pattern correlations from extracted information within the big data data sets have not been established.

The research question:
What are the strategies for establishing common pattern correlations from extracted information within the big data sets?

Research study participation:
            For data collection, this research study needs at least 10 participants for semi-structured interviews. The interviews may be conducted in face-to-face or by Skype video conference calls in a nationwide scope. The potential participants are professionals who have knowledge, understanding, and experience in working with data, information systems or Big Data. Each participant will answer about 10 interview questions. 

Benefits of Participation
There may/may not be direct benefits to you as a participant in this study. However, we hope to learn that the possible strategies that you contribute and provide will help the organizations to improve the way to establish common pattern correlations, assist a decision making, enhance productivity, and gain the competitive edge. Your contribution will be recognized and acknowledged in the dissertation.

Confidentiality
            In Data Collection and Data Analysis, coding will assign values used to mask off the participants’ identities. Data and records will be securely stored in the the locked cabinet. Only authorized individuals are allowed to access data or records. The records will be destroyed after the study is complete.

Contact information:
If you like to participate this research study or have any questions or concerns about the study, you may contact me (ThienSi Le) at
     - Cell phone number: 774-266-1926
     - Linkedin social media network: https://www.linkedin.com/in/thiensile/

 For questions regard the rights of research subjects, any complaints or comments regarding the manner in which the study is being conducted, you may contact Colorado Technical University – Doctoral Programs at 719-598-0200.