Posts Tagged nepal

My experience of earthquake in Nepal

It was a nearly a middle of a day [Saturday April 25 2015] while me and my friend were talking about our last journey from Kathmandu(Nepal) to Raxaul(India) (friend’s brother’s wedding) and we were so tired as we returned back to Kathmandu just Friday. I was forcing my friend to get off from the bed and take a breakfast but suddenly I felt dizzy movement which was an earthquake, it was so quick with very high intensity of movement. I could easily decide that was a massive quake because there was a mass of crackling sound coming from around my house and those sounds were new to me. I grabbed one big pillow from bed and brought my friend to cover up with that big rectangular pillow. We were sitting side by side near by door frame with our knee down position covering our heads. We were having a tough moment at that time and convince each other for not getting panic. After that massive shake my father and elder brother came down to the ground floor where I am living, Everybody were so terrified by this first sudden quake, we were planning for staying at ground floor for next 5 minutes as it was not quiet safe to go out from home at that moment. I looked outside my window to see the condition and there were people running and I saw my bike fell down and quickly went outside to keep my bike in double stand position. The road way of my house was already cracked, my neighbor’s house also had cracks at the basement, I checked my house as well but it was not hurt.

Read the rest of this entry »

Tags: , , , , ,

A simple Lucky draw Program

Here I’m going to show a simple program which picks random 6 character and assigns the point for that code no.

If it consists vowel letter then

a =1, e=2, i=3, o=4,e=5

and if no any vowel letter then it is awarded by 100 pts.

If you to download code then (CLICK HERE)

The program is given below:
[sourcecode=’java’]
//import directives for Input of Keyboard
import java.util.Scanner;

public class LuckyDraw
{
//ATTRIBUTES
static String name;
static int point = 0;
char[] code;
String setOfAlphabet;

//CONSTRUCTOR
public LuckyDraw(){
code = new char[6];
setOfAlphabet = “abcdefghijklmnopqrstuvwxyz”;
}

//looping the random character
public void loop(){

//handling two side :
//one at loop
//other at assgning the char in char array;
int i=0;

//flag of the while loop
boolean flag = true;

while(flag){

int b = (int)(Math.random()* setOfAlphabet.length());
code[i] = setOfAlphabet.charAt(b);
i++;

//condition for stopping loop
if(i == 6) flag = false;

}
}

//assigns the points
public void points(){

//design
System.out.println(“\n\n———————————\n”);
System.out.println(“Name\t\t\t\t\t:”+this.name);
System.out.print(“Your code No\t\t\t:”);

for(char a : code){
System.out.print(a);
//assing the score
if(a == ‘a’)point += 1;
if(a == ‘e’)point += 2;
if(a == ‘i’)point += 3;
if(a == ‘o’)point += 4;
if(a == ‘u’)point += 5;
//exception if there are no any vowel letter
// then give 100 point
if(point == 0) point = 100;

}

System.out.println(“\n”);
System.out.printf(“Your have scored\t\t:%s pts\n”,point);
System.out.println(“\n———————————“);

}

//main method
public static void main (String[] args)
{
//giving input of name
Scanner scan = new Scanner(System.in);
System.out.print(“Please enter your name\t:”);
name = scan.next();

//invoking the methods to display
LuckyDraw lucky = new LuckyDraw();
lucky.loop();
lucky.points();

}

}
[/sourcecode]

Tags: , , , , , , ,