Posts

Showing posts from March, 2013

How to get User Input from User in java??

program to get User Input in java import java.util.Scanner; public class UserInput { public static void main(String args[]) { Scanner obj=new Scanner(System.in); int number; String str; float f; System.out.println("Enter the String? :"); str=obj.nextLine(); System.out.println("You have entered the string:"+str); System.out.println("Enter the number ?"); number=obj.nextInt(); System.out.println("You have entered the number:"+number); System.out.println("ENter the float number"); f=obj.nextFloat(); System.out.println("YOu have entered the float value:"+f); } } java.util has a class named “scanner” which is used to read different types of values from users. Scanner obj=new Scanner(System.in); In this statement Scanner is the class name,obj is the Object of the Scanner class and System.in is the input stream. str=obj.ne

What is state of art??

What is state of art?? Many people used to say you have to know the state of art...so i try to find what is actually state of art.. According to wikipedia:         It defines it as the level of knowledge and development achieved in a technique,science.... In other words it is also defined as staying with the up to date knowledge in order to make advancements in the already existing knowledge....

CPSR For ARM7

Image
First Five Bits are used to select the one of the modes.

Hardware Abstraction Architecture of TInyOS

Hardware Abstraction Architecture of TInyOS The Hardware Abstraction Architecture of TinyOS has three layers.. 1. Hardware Presentation Layer : It is the lowest layer. It provides the lowest level access to the hardware, and provides wrappers around lowest level tasks,such as setting registers with higher level software calls. Components in this layer are not expected to be used from user program as any functionality they provide should be exposed by higher levels above it. Components should be efficient,because many higher level components may call it simultaneously. 2.Hardware Adaptation Layer: It is above the Hardware Presentation Layer. Contains most of the platform code. Exposes one or more components for each piece of functionality the mote provides. HAL components provide advanced functionality of the program at the expense of programs using them become platform-specific. 3.Hardware Interface Layer: The

My First perl program

My First perl program: Create a file with filename.pl #!/usr/bin/perl print "Hello World.\n"; First Line: Every program starts with this line..It is the perl interpreter and will vary from system to system ... To Know about your interpreter type in command prompt $which perl Second Line: It is used to print the Hello World on the screen.. To execute type in command prompt $perl filename.pl

MOTE -PC COMMUNICATION in TinyOS

MOTE -PC COMMUNICATION in TinyOS STEP1:Install the TestSerial Application on your mote. The application sends a packet over the serial interface for every second,and when it receives a packet it displays the binary equivalent over the LED's. STEP2:Once you have installed application on the mote.we need to run the corresponding java application to communicate with the serial port. This is build when we install the application on the mote. From the application directory type java TestSerial<-' If you get an error like sf@localhost:9002 died - exiting (java.net.ConnectException: Connection refused) It means you have not specified the serial port as source you have to specify in the syntax Type export MOTECOM=serial@/dev/ttyUSB0:telosb for telosb mote. STEP3: Now when you type java TestSerial <-' , you will get output like Received packet sequence number 317 Sending packet 1 Received packet sequence number 318 Sending pac

C-language 63 programming Questions

C-language 63 programming Questions 1. What are storage classes in 'C' language? a)auto keyword b)static keyword c)register keyword d)extern keyword e)automatic f)static 2. What are the storage class specifiers in c language? 3. How many variables scopes are there in c language? 4. main() { int i; for(i=0;i<5;i++) { static int a=0; int b=0; a++; b++; printf("\na=%d",a); printf("b=%d",b); } } 5. main() { static int s; ++s; printf("\n%d",s); if(s<=3) main(); printf("\n%d",s); } 6. extern int a; main() { printf("\na=%d",a); return 0; } 7. int a; main() { printf("\na=%d",a); return 0; } 8. extern int a; main() { printf("\na=%d",a); return 0; }int a; 9. extern int a; main() { printf("\na=%d",a); return 0;

c-language 97 programming questions

c-language 97 programming questions 1. #include<stdio.h> void main() { printf("%d%d%d\n",50,100); } 2. void main(){ a=3.5; printf("%d",a); } 3. void main(){ printf(%d%d",100,200,300); } 4. void main(){ printf(2+3=%d",2+3); } 5. void main(){ int a; a=3+5*5+3; printf(%d,a); } 6. void main(){ int a; a=printf("sumit%d",printf("sumit)); printf("%d",a); } 7. void main(){ printf("%d",%d",47%5,47%-5); printf("%d%d%d",-47%5,-47%-5,5%7); } 8. void main(){ int a; float f; a=12/5; f=12/5; printf("%d%f",a,f); } 9. void main(){ int a,b; a=b=100; scanf("%d%d",a,&b); //enterde value are 40,85 printf("%d%d",a,b); } 10.

C-language 56 programming Questions

C-language 56 programming Questions 1. #include<stdio.h> void main() { int arr[]; arr[1]=10; printf("%d",arr[0]); } 2. #include<stdio.h> void main() { int arr[2]={10,20,30,40}; printf("%d",*(arr+2)); } 3. #include<stdio.h> void main() { int arr[2]={10,20}; arr[2]=30; arr[3]3=40; printf("%d",*(arr+3)); } 4. #include<stdio.h> void main() { int arr[2]={10,20}; *arr=30; *(arr+1)=40; printf("%d%d",arr[0],1[arr]); } 5. #include<stdio.h> void main() { int a=1; void xyz(int,int); xyz(++a,a++); xyz(a++,++a); printf("\n%d",a); } void xyz(int x,int y) { printf("\n%d%d",x,y); } 6. #include<stdio.h> void abc() { ++a; } void main() { int a=1; abc(); printf("

Characteristics of LoWPAN's

Characteristics of LoWPAN's are as follows: 1. Small packet size : Maximum physical layer packet size=127 bytes.                                 Maximum frame size at the media aceess control layer=102 octets                                Link-layer security imposes further overhead,which in the maximum case has                                   21  octets as overhead leaving 81 octets for data packets. 2. Support for both 16-bit short or IEEE 64-bit extended media access control addresses. 3.L ow Data rates :  Data rates --->Physical Layer                               250kbps  ---->2.4GHz                               40kbps    ----> 915MHz                               20kbps   ----->868MHz 4.Topologies : Mesh,Star. 5. Low Power : As most of the devices are battery operated. 6. Low Cost :    As devices are typically associated with sensors,switches etc..so it requires less                                processing,low memory which in turn is not