Friday, 6 February 2009

Just for the sake of boring ness

import java.util.Scanner;
public class SwitchCase {
public static void main (String args[])
{
Scanner s = new Scanner (System.in);
System.out.println (" Select 1 - 12 to view the month");

int x =s.nextInt();

switch (x){
case 1:
System.out.println ("January");
break;

case 2:
System.out.println ("Febuary");
break;

case 3:
System.out.println ("March");
break;

case 4:
System.out.println ("April");
break;

case 5:
System.out.println ("May");
break;

case 6:
System.out.println ("June");
break;

case 7:
System.out.println ("July");
break;

case 8:
System.out.println ("August");
break;

case 9:
System.out.println ("September");
break;

case 10:
System.out.println ("October");
break;

case 11:
System.out.println ("November");
break;

case 12:
System.out.println ("December");
break;

default:
System.out.println ("-------------------------");
System.out.println ("|**** | ");
System.out.println ("|**** ( )");
System.out.println ("|**** | ");
System.out.println ("|**** / | \\ ");
System.out.println ("|**** / | \\ ");
System.out.println ("|**** | ");
System.out.println ("|**** / \\ ");
System.out.println ("|**** / \\ ");
System.out.println ("|****");
System.out.println ("-------------------------------------------------------------");
System.out.println ("U have select the wrong number");
break;

}

}
}

Tuesday, 3 February 2009

Switch !!

//*Calculate walt

#include
void main ()
{
int x;
printf ("Please enter the light bulb's wattage in the following list.\n");
printf ("|15|25|40|60|75|100|\n");
scanf ("%d",&x);

switch (x){
case 15:

printf ( "The brightness is 125. \n");
break;

case 25:

printf ( "The brightness is 215. \n");
break;

case 40:

printf ( "The brightness is 500. \n");
break;

case 60:

printf ( "The brightness is 880. \n");
break;

case 75:

printf ( "The brightness is 1000. \n");
break;

case 100:

printf ( "The brightness is 1675. \n");
break;
default:

printf ( "The brightness is -1. \n");
break;
}
}

C programming

#include
void main ()
{
float n;
printf ("Please enter the scale of the earthquake.\n");
scanf ("%f",&n);

if (n<5.0)
printf ("Little or no damage. \n");
else if (n >=5.0 && n < 5.5)
printf ( "Some damage. \n");
else if (n >= 5.5 && n < 6.5)
printf ( "Serious damage: walls may crack or fall. \n");
else if (n>=6.5 && n < 7.5)
printf ("Disaster: house and building may collapse. \n");
else if (n>= 7,5)
printf ("Catastrophe: Most building destroyed.\n");
printf ("GG.COM\n");
printf (" * \n");
printf (" ***** \n");
printf (" ***** \n");
printf (" ******* \n");
printf (" ********* \n");
printf (" ************* \n");
printf (" *************** \n");
printf (" ***************** \n");


}

Coding q3 *JAVA*

To calculate sum,product,average,smallest,largest

import java.util.Scanner;
public class Application {
public static void main (String args[])
{
Scanner s = new Scanner (System.in);
System.out.println (" Enter your number:");
int sum, product,smallest,largest;
float average;
int x =s.nextInt();
int y =s.nextInt();
int z =s.nextInt();
sum = x+y+z;
average = (x+y+z)/3;
product = x*y*z;
System.out.println ("The sum of the 3 integer is " +sum);
System.out.println ("The average of the 3 integer is " +average);
System.out.println ("The product of the 3 integer is " +product);
if (x>y && x>z)
System.out.println ("The largest integer is " +x);
else if (y>x && y>z)
System.out.println ("The largest integer is " +y);
else
System.out.println ("The largest integer is " +z);
if (xSystem.out.println ("The smallest integer is " +x);
else if (ySystem.out.println ("The smallest integer is " +y);
else
System.out.println ("The smallest integer is " +z);
}
}

WTF CODE

import java.util.Scanner;
public class q4
{
public static void main (String args[])
{
Scanner s = new Scanner (System.in);
System.out.println (" Enter 5 number:");
int pos = 0,neg = 0,zero = 0,x;
int num1 =s.nextInt();
int num2 =s.nextInt();
int num3 =s.nextInt();
int num4 =s.nextInt();
int num5 =s.nextInt();
if (num1 >0)
pos++;
else if (num1<0)
neg++;
else
zero++;
if (num2 >0)
pos++;
else if (num2<0)
neg++;
else
zero++;
if (num3 >0)
pos++;
else if (num3<0)
neg++;
else
zero++;
if (num4 >0)
pos++;
else if (num4<0)
neg++;
else
zero++;
if (num5 >0)
pos++;
else if (num5<0)
neg++;
else
zero++;
System.out.println ( " The number of posittive numbers are " +pos);
System.out.println ( " The number of negative numbers are " +neg);
System.out.println ( " The number of zero numbers are " +zero);
}
}

Sunday, 4 January 2009

Back in K L again

Back in Inti Nilai again !!
Fully recharge and ready to hit the books.... *mebi la*
But to kickstart my 3rd sem in Inti i m gonna visit my favourite spot....the cyber cafe :D jajaja

Wednesday, 15 October 2008

Optical Illusions

So long haven updated the blog : D
Been busy with test and assignment.
So now gonna show some cool opticall illusions i found in da net




I love this illusion the best : D


U stare at 5 dot for 20 seconds then look at a blank wall and keep on blinking


who will u see :D ?








Look like a hole in the middle put is actually just a painting.