29, ఫిబ్రవరి 2012, బుధవారం

PhD RELATED JOURNAL INFORMATION


PhD information 
Conferences not accepted for this jornoual publishing is must
for example Topic  “c-trend”
Literature review    papers    scholor.google.com    - advanced search – topic c-trend    year 2009-10  click on maths and computerscience&engineering pdf books -50 papers
Net bks.org source code for exewtrins      
download related  books

For source code free down load      après.com
Executions and advancements  to Guide and HOD
Doc
Appendix
Pseudo code
Ppts
Our journal publication

Title
Abstract
Research Committee 
 1  sign
 2  sign
 3  sign
HOD sign

Engineering journals
IJCSE
IJEST
IJET
IJCSIT.COM  @3000 Rs only
IJRTE              @5000
Engineers network.org 
Total 5 international journals

. LEAPYEAR - ONE OF THE BIG ISSUES IN THE Y2K PROBLEM AND HERE I AM INTRODUCING DIFFERENT TECHNIQUES IN JAVA FOR THE FINDING THE GIVEN YEAR IS LEAP OR NOT

 code snippet
public class lr {

    public static void main(String[] args) {
//u can add here any input mechanisim like Scanner or concole or DataInputStream or 
//BufferedReader to make this program as interactive   
   
   
   
   
   
   
   
   
  

DataInputStream keyboard = new DataInputStream (System.in);
       System.out.println ("Calculator Ready: enter a value");
          year = keyboard.readInt ();
int year  = 2011;
        if(year%400==0){
            System.out.println("is a leap year");
        }else if(year%100==0){
            System.out.println("is not a leap year");
        }else if(year%4==0){
            System.out.println("is a leap year");
        }else{
            System.out.println("is not a leap year");
        }
    }
}


code snippet
The following program uses the java.util.Calendar class and its methods to 
determine whether a year is leap year or not


import java.util.Calendar;

public class JavaCalendarLeapYearExample {
    public static void main(String[] args) {
        // this variable holds the value of year in question
        int year = 2011;
        // gets the instance of Calendar
        Calendar calendar = Calendar.getInstance();
        // sets the calendar to 31st December of the Year
        calendar.set(year,Calendar.DECEMBER,31);
        // check the no of days of the year
        if(calendar.get(Calendar.DAY_OF_YEAR)==366)
            System.out.println("is a leap year");
        else
            System.out.println("is not a leap year");
    }
}




 
function isLeapYear (year):
 if ((year modulo 4 is 0) and (year modulo 100 is not 0)) or (year modulo 400 is 0)
  then true
 else false
  
This program ignores changes in the Gregorian calendar and only
 applies correctly to dates after 1582.
//DOC  @author Mr.RamuDayinaboyin @author free lancer  @version 9/17/2011
 import java.io.*;
public class LeapYear {
    public static void main (String[] args) {

 // The year to check for leapiness.  
int Yr;

 // Get the year. For now we'll assume they enter a reasonable value. 
System.out.print("Enter the year: ");
 Yr = Console.in.readInt(); 
// Check for a 2 digit year and adjust the year using a windowing technique. 
If the date has more than 2 digits we'll assume it is a complete year. 
if (Yr < 100) {
 // If the year is greater than 40 assume it is from 1900's.  If the year is less 
than 40 assume it is from 2000's.      
if (Yr > 40) {
  Yr = Yr + 1900;
     }
     else {
  Yr = Yr + 2000;
     }
 }
 // Is theYear Divisible by 4?  
if (Yr % 4 == 0) {
     // Is theYear Divisible by 4 but not 100?      
if (Yr % 100 != 0) {
  System.out.println(Yr + " is a leap year.");
     }
     // Is theYear Divisible by 4 and 100 and 400?      
else if (Yr % 400 == 0) {
  System.out.println(Yr + " is a leap year.");}
// It is Divisible by 4 and 100 but not 400!      
else {
  System.out.println(Yr + " is not a leap year.");}}
// It is not divisible by 4. 
else {
     System.out.println(Yr + " is not a leap year.");}}}
 
 
 
 
 
Another Logic   
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
public class LeapYrDemo {
public static void main(String[] args) {
        try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter num");
int yr = br.read();
int num = yr;
if(num/100== 0){
    if(num/400==0){
        System.out.println("Leap year");
        }
    else
        System.out.println("not leap yr");
}
else if(num/4==0){
    System.out.println("leap yr");
}
else
    System.out.println("Not a leap yr");
} catch (IOException ex) {
Logger.getLogger(LeapYrDemo.class.getName()).log(Level.SEVERE, null, ex);
        }
}
}
The output for the above program is
Enter num2012
Leap year
BUILD SUCCESSFUL (total time: 2 seconds)
but in the above code some bug is inside whenever i am free i will rectify it 
 
another snippet for the leap year logic is by using assertions  put this code in
a class  
public static boolean isleap(int y)
{
assert y>=1583
 return((y%4==0)&&(y%100!=0)) ||(year % 400==0);
} 
call like below
assertTrue(isleap(2012)); 

CLASSES ,OBJECTS,CONSTRUCTORS, INPUT/OUTPUT, LOOPS AND STRINGS IMPLEMENATAION IN A SIMPLE JAVA PROGRAM

java language allows three types of comments
1)single line comments //
2)multiline comments /* ...*/
3)Documentation comments /** .. */

The key considerations were summed up by the Java team in the following list of buzzwords:
SIMPLE       easy to learn and use
 SECURE  programs are confined to the Java execution environment and cannot access other parts of the computer.
 PORTABLE
 OBJECT-ORIENTED  a clean, usable, pragmatic approach to objects, not restricted by the need for compatibility with other languages.
 ROBUST    allow the programmer check the mistakes early performs compile-time (strong typing) and run-time (exception-handling) checks, manages memory automatically.
 MULTITHREADED     writing program that perform concurrent computations
 ARCHITECTURE-NEUTRAL J V M provides a platform independent environment for the execution of Java byte code
 INTERPRETED  compiled into an intermediate byte code
 HIGH PERFORMANCE
 DISTRIBUTED Java handles TCP/IP protocols, accessing a resource through its URL much like accessing a local file.
DYNAMIC substantial amounts of run-time type information to verify and resolve access to objects at run-time.


Data Types :- Java defines eight simple types:
1)byte – 8-bit integer type
2)short – 16-bit integer type
3)int – 32-bit integer type
4)long – 64-bit integer type
5)float – 32-bit floating-point type
6)double – 64-bit floating-point type
7)char – symbols in a character set
8)boolean – logical values true and false


Scope of a variable:-
A variable declared inside the scope is not visible outside:
{
int n;
}
n = 1;// this is illegal

Two styles of array declaration:   type array-variable[];or   type [] array-variable;
Multidimensional arrays are arrays of arrays:
1) declaration:     int array[][];
2) creation:          int array = new int[2][3];
3) initialization    int array[][] = { {1, 2, 3}, {4, 5, 6} };

 bitwise operators
~
~op
Inverts all bits
&
op1 & op2
Produces 1 bit if both operands are 1
|
op1 |op2
Produces 1 bit if either operand is 1
^
op1 ^ op2
Produces 1 bit if exactly one operand is 1
>> 
op1 >> op2
Shifts all bits in op1 right by the value of op2
<< 
op1 << op2
Shifts all bits in op1 left by the value of op2



A class is a blueprint that defines the variables and methods common to all objects of a certain kind.
Example: ‘your dog’ is a object of the class Dog.
An object holds values for the variables defines in the class.
An object is called an instance of the Class

Real world objects are things that have:
Example: your dog:
state – name, color, breed, sits?, barks?, wages tail?, runs?
behavior – sitting, barking, waging tail, running
A software object is a bundle of variables (state) and methods (operations).


A SAMPLE PROGRAM WHICH EXPLAINS THE CONCEPT OF CLASSES AND OBJECTS
import java.io.*;
import java.lang.*;
class box
{
//INSTANCE OR CLASS VARIABLES 
int length;
int breadth;
int height;
//method-1 constructor
box()
{
length=1;
breadth=2;
 height=2;
}
//method-2  reading data
void getdata(int l,int b, int h)
{
length=l;
 breadth=b;
 height=h;
}
//method-3 display the values on the screen
void display()
{
System.out.println("the values of box are "+length+"  , "+ breadth+ "  ,   "+height);
}
//method-4 calculation of the volume
void volume()
{
int volume;
volume=length* breadth* height;
System.out.println("the volume is"+volume);
}
}


//SECOND CLASS the above class implementation is done here
public class boximpl
{
public static void main(String args[]) throws Exception
{
//here we are initilizing the data to the object through constructor
box b=new box();
b.display();
b.volume();

//here we are reassigning values through method which is already done by the constructor
b.getdata(1,2,3);
b.display();
b.volume();


/*now we will consontrate how repeatedly do the volume calculation by taking concern of user each and every iteration this can be done by so many was here i assisted the string class  and activating of one of the reader class for user input*/ 
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s="yes";
while(s.equals("yes"))
{
System.out.println("WELCOME TO THE NEW ITERATION"+'\n'+'\n');
System.out.println("enter the value for the length");

int l1= Integer.parseInt(br.readLine());
System.out.println("enter the value for the breadth");
int b1= Integer.parseInt(br.readLine());
System.out.println("enter the value for the height");
int h1= Integer.parseInt(br.readLine());

b.getdata(l1,b1,h1);
b.display();
b.volume();
System.out.println("do u wants repetation ");
 s=br.readLine();
}
}//end of main()
}//end of


OUTPUT:-
compilation and interpretation
e:\ramu>javac boximpl.java


e:\ramu>java boximpl

The values of box are 1  , 2  ,   2
The volume is4
The values of box are 1  , 2  ,   3
The volume is6
WELCOME TO THE NEW ITERATION


enter the value for the length
1
Enter the value for the breadth
2
Enter the value for the height
3
The values of box are 1, 2,  3
The volume is6
Do u wants repetition
Yes

Access Specifiers: An access specifier is a key word that represents how to access a member
of a class. There are four access specifiers in java.
private: private members of a class are not available outside the class.
public: public members of a class are available anywhere outside the class.
protected: protected members are available outside the class.
default: if no access specifier is used then default specifier is used by java compiler.
Default members are available outside the class.


IN THIS I AM FRAMING HOW WE WILL PASS OBJECTS AS REFERENCE TO THE SAME CLASS ANOTHER OBJECT METHOD 
class Complex
{
private int real,imag;
public void Complex(int x,int y)
{
real=x;
imag=y;
}
Complex()
{
real=10;
imag=20;
}
public void Complex(int x)
{
real=x;
}

public void display()
{
System.out.println(+real+"i"+imag);
}

public void add(Complex c1, Complex c2)
{
real=c1.real+c2.real;
imag=c1.imag+c2.imag;
}}
class ramu
{
public static void main(String args[])
{
Complex c1 = new Complex();
Complex c2 = new Complex();
Complex c3 = new Complex();
c1.display();
c2.display();
c3.display();
c1.Complex(1,2);
c2.Complex(2,3);
c1.display();
c2.display();
//here I am passing to the same class object references two the third class object method add()
c3.add(c1,c2);
c3.display();
}}

STRING CLASS

String strOb1 = "First String";
String strOb2 = "Second String";
String strOb3 = strOb1;
  strOb1.length();    strOb1.charAt(3);
if(strOb1.equals(strOb2))

String myString = "I" + " like " + "Java.";  //in this + string operator concatenation  variable contains ilikejava