Saturday, November 26, 2011

IT13: exer2(my answer) JAVA language


Name: Janer, Jesson L.
Section: Set A
Time: TF(1:00-2:30)  
Exercise: 1

Code:

public class exercise2{
      public static void main (String[] args) {
           
            String msg = "Hello World, This is a test ! :)";
            string_classes.display_msg (5,msg);

System.out.println ("\nThe reverse string is: " +string_classes.reverse_msg (msg));
System.out.println ("\nThe no of vowels in a string is: "  +string_classes.no_of_vowels (msg));
System.out.println ("\nThe no of consonants in a string is:" +string_classes.no_of_consonants(msg));
System.out.println ("\nThe no of special characters in a string is: "  +string_classes.no_of_special_chars (msg));
System.out.println ("\nThe no of characters occurences:  ");
string_classes.char_occurences (msg);
      }
}

public class string_classes {
            public static void display_msg(int x, String msg){
                  for(int i = 0; i < x ; i++){
                        System.out.println ("\n" +msg);
                        }
                  }

            public static String reverse_msg(String msg){
                  String str_reverse = " ";
                  //Enter your solution here.....
                 str_reverse = new StringBuffer(msg).reverse().toString();
                 return str_reverse;
                  }

            public static int no_of_vowels(String msg){
                  int nvowels = 0;
                  //Enter your solution here.....
                  String tester="aeiou";
             for(int a=0;a<msg.length();a++){
                   for(int b=0;b<tester.length();b++){
                     if((msg.toLowerCase()).charAt(a)==(tester.charAt(b)))nvowels++;
                              }
                }
                     return nvowels;
                  }


            public static int no_of_consonants(String msg){
                  int nconsonants = 0;
                  //Enter your solution here.....
              String tester="bcdfghjklmnpqrstvwxyz";
              for(int a=0;a<msg.length();a++){
                  for(int b=0;b<tester.length();b++){
                   if((msg.toLowerCase()).charAt(a)==(tester.charAt(b)))nconsonants++;
                    }
                }
                        return nconsonants;
                  }

            public static int no_of_special_chars(String msg){

                  int sp_chars = 0;
                  //Enter your solution here.....
                  String tester="~`!@#$%^&*()-_+={}[];:',.></?|";
                for(int a=0;a<msg.length();a++){
                   for(int b=0;b<tester.length();b++){
                     if((msg.toLowerCase()).charAt(a)==(tester.charAt(b)))sp_chars++;
                              }
                   }
                        return sp_chars;
                  }


            public static void char_occurences(String msg){
            //Enter your code here...
            /* Sample output: Hello World, This is a test ! :
             *H - 2, e - 2, l - 3, o - 2, W - 1, r - 1 d - 1,
             *T - 3, i - 2, s - 3, a - 1
             *
             */
    String tester="abcdefghijklmnopqrstuvwxyz";
    boolean t=true,th=true;
    int no=0;
    String char_passed=" ";
          
    System.out.println(msg);
          
    for(int a=0;a<msg.length();a++){
          
            for(int b=0;b<tester.length();b++){
           if(msg.toLowerCase().charAt(a)==tester.charAt(b)){
                 t=true;
                 b=27;
                }else{
                 t=false;
                }
           }
          
            if(t==true){
        for(int c=0;c<msg.length();c++){
           if(msg.toLowerCase().charAt(a)==msg.toLowerCase().charAt(c))no++;
             }
                    
        for(int d=0;d<char_passed.length();d++){
           if(msg.toLowerCase().charAt(a)==char_passed.charAt(d)){
                th=false;
                d=100;
                }
           }
                  
           if(th==true){
               System.out.println(msg.charAt(a)+ "-"+no);
               char_passed=char_passed+msg.toLowerCase().charAt(a);
                   }
          }
                    t=true;
                    th=true;
                    no=0;

     }

       }

}

IT13: exer1(my answer) JAVA language



Name: Janer, Jesson L.

Section: Set A
Time: TF(1:00-2:30)  
Exercise: 1

Code:

public class Exercise1{
public static void main (String[] args) {

       int x[] = {23, 6, 47, 35, 2, 14};

       num_classes.display_num (x);
       System.out.println ("\nSum of all integers: " +num_classes.sum_all(x));

       System.out.println ("\nAverage of a given integers: " +num_classes.get_ave (x));

       System.out.println ("\nLargest integer: " +num_classes.get_max (x));

       System.out.println ("\nSmallest integer: " +num_classes.get_min (x));

       System.out.println ("\nNumber of ODD integers: " +num_classes.get_no_of_odd (x));

       System.out.println ("\nNumber of EVEN integers: " +num_classes.get_no_of_even(x))
}
}

public class num_classes {
      public static void display_num(int x[]){
            for(int i=0; i < x.length; i++)
                  System.out.println (x[i]);
            }

      public static int sum_all(int x[]){
            int sum = 0;
            // type your solution here
            for(int i=0; i < x.length; i++){
            sum = sum + x[i];
                  }
            return sum;
            }

      public static int get_ave(int x[]){
            int ave = 0;
            // type your solution here
            int sum=0;
            for(int i=0; i < x.length; i++){
           sum=sum+x[i];
            }
           ave=sum/x.length;
           return ave;
            }

      public static int get_max(int x[]){
            int max = 0;
            // type your solution here
            for(int i=0; i < x.length; i++){
            if(x[i]>max)max=x[i];
                  }
                  return max;
            }

      public static int get_min(int x[]){
            int min = 0;
            // type your solution here
            for(int i=0; i < x.length; i++){
                  if(i==0)min=x[1];
                  if(x[i]<min)min=x[i];
                  }
                  return min;
            }

      public static int get_no_of_odd(int x[]){
            int n_odd = 0;
            // type your solution here
            for(int i=0; i < x.length; i++){
            if(x[i]%2!=0)n_odd++;
                  }
                  return n_odd;
            }

      public static int get_no_of_even(int x[]){
            int n_even = 0;
            // type your solution here
            for(int i=0; i < x.length; i++){
                if(x[i]%2==0)n_even++;
                  }
                  return n_even;
            }


}



Tuesday, October 4, 2011



To be honest, I was never interested in this drama when I first saw it advertised on TV. But when I started watching a few episodes, I have come to like it. Idk why but something about the story of the series drew me to it, and so it has become one of my must watch drama series ^_^ If you haven't heard about this drama, I'll first give you an over view.
Drama Title: 49 Days
Genre: Fantasy, Romance
Casts: Jo Hyun Jae, Jung Il Woo, Lee Yo Won, Nam Gyu Ri, Bae Soo Bin
Summary: A young woman named Ji Hyun was enjoying absolute bliss as she was about to be married with her fiancé, but her perfect life is shattered in a car accident that left her in a coma. She is given a second chance at life by a reaper, but it comes with a condition: she has to find three people outside of her family who would cry genuine tears for her. In order to do this, she borrows the body of Yi Kyung, a part-time employee at a convenience store.

My Review
Just like what I said, I wasn't really into this drama until I saw a few episodes. The story for me is quite unique, more of so not true or far from reality. Imagine a dead people being given the chance to live again. I mean yeah that could be possible, but no one can really prove it. I like the lead actress Ji Hyun (Nam Gyu Ri), she is very pretty and so kawaii. I must admit she was one of the reasons why I watched because she is so doll like and cute. And of course, no drama would be completed without a bad character, which for me is Shin In Jung. I really hate her in this drama, though I must admit she is pretty too but nah, how could she do such things to her best friend? Evil girl. Sometimes love really makes us do things that are so bad.
The plot for me was unpredictable. As Ji Hyun neared his 49th day, I never thought that she would be able to accomplished what she has to do. I was extremely happy when Ji Hyun was able to live because she can be happy now with Han Kang but an unexpected thing happen :| . I was truly crying and crying the whole time while watching this because Ji Hyun died in the end ^silly me for crying so hard lol^ . Anyways, this drama has a lot of twists in the story thats why I loved it. Who would have thought that the scheduler and Song Yi Kyung were once lovers? And although the reasons why Ji Hyun should use only Yi Kyung's body was stated, there was another reason behind it. Can you guess what? I totally wasn't expecting that they were sisters! Yes, in the end of the drama the truth was uncovered, and that Ji Hyun and Yi Kyung were sisters. Pretty much interesting :)
There were many scenes in the drama that made me cry, especially during the last few episodes. Yi Kyung and Yi Soo's scenes made me cry a river. I didn't know a love like that could exist, even in death. I could somehow feel the pain of the characters, especially when Yi Soo (scheduler) said that Yi Kyung should let him go because it would be the only way that they could both be happy. Letting go is never easy *tears are starting to fall again lol* . Maybe I was just able to relate it to my own situation that's why I was crying a lot :) But really, I suggest that you watch this drama. This is the third korean drama that made me cry, first was Endless Love I (Autumn in my Heart), then came My Girlfriend is a Gumiho, and now this :( To be honest, the ending disappointed me. I was already at that point where the story was so good and then suddenly it ended like that. But nevertheless I still love the plot, and the characters in this drama.
Okay enough babbling, I know you want to watch 49 Days so I'll give you the link. You can watch 49 Days online on this site. I'm sure you wont regret it :)
And now for some screen shots that I made... enjoy ^_^ and happy watching.
And that's it. Hope you enjoyed reading my review :)

Friday, June 24, 2011

S+A+D=sad (story about love)....

May isang girl waiting for her boyfriend...

On the first day, she sent a message to the guy saying, "miss you na! what time ka ba pupunta?"

She's waiting for the reply.. but the guy didn't reply.

Second message: "I text you kaninang morning bat di ka nagreply... what time ka ba pupunta?! I need your answer asap..."

She waited for 5 hours, la paring sagot... Sa sobrang asar, ini-off nya ang CP nya and said, "I will not open this cellphone unless pumunta cya dito.." After a few minutes, nakatulog na yung girl...

Second day, she's still waiting for her boyfriend. Magpaparing sa fone tapos baba. She told herself, "Did he love me pa ba?!" He Knows naman pag napgpaparing ako..

She's expecting that the boy will call him back.. untik its evening and no one came, no one called.. her CP still off...

Third day, she's still waiting. Nagpaparing. After a few hours, the phone rung... She answered it quickly... "Hello" On the second line, "Hon, I love you very much.." Biglang nag busy. Galit na galit na umupo sa sofa at nanood ng t.v.

After a few minutes, may kumakatok. She stood quickly and opened the door. She opened the door. She was surprised when she saw her bf standing at the door. With good looks, white long sleeves and white pants...

The guy said, "Come with me... hayaan mo akong bumawi sayo..."

She answered, "Wait, I'll just..."

"Come let's go..." After a few minutes, they're on some place. Sa house ng guy.. kinabahan cya..

She's asking.. what happened?.. bat and daming tao.. at may red light.. What's that?... (she stopped for a while). "Your mom" walang sagot... The guy only looking at her face...

Biglang may tumawag sa kanya. She's shocked when she saw the guy's mom crying and embraced her...

"Come with me! Sa buong pag aakalang nakasunod sa kanya ang guy. On the door, she's shocked when she saw a dead person infront of her... She looks at her back.. but the guy is gone.. where he went, di nya alam... La naman siyang nakita dumaan infront of her..

The mother said, "Bat ngayon ka lang pumunta kahapon pa ako ng text sayo! Pero naka off ang phone mo.. She opened her CP and sat for a while and read the messages...

There are 5 unread messages... She opened the first message... "Hija, my son is now 50/50. Come here, he needs you..."

The second message: "Please come here or reply... I need it now.."

Third message: "My son is on comatose... Can you visit him now?... You're his strength.."

Fourth message: "Hija, my son is dead" and then she cried to think that her love is now gone in her life... Naisip nya yung nangyari...

She's with the guy the past few hours.. But she kept on thinking.. hangang dumating ang kanyang pag-iisip sa guy... "Come let's go"... "Dalawin mo naman ako.. kahit sa huling araw ng lamay ko..."