Pattern Codes, ABCDE Code, Arduino Code

Saturday 18 March 2017

Program to print String as a Hexcode in java


Program to print String as a Hexcode

Output:

Enter the string to print the hexcode
String length BCDEOFGEHB0E8F82
String value 16

0xBC,0xDE,0xOF,0xGE,0xHB,0x0E,0x8F,0x82

Code:-

import java.util.*;
import java.lang.*;

public class hexcode
{
  public static void main(String[] args)
  {
    int i , n,count,val,val1=0;
    System.out.println("Enter the string to print the hexcode");
    String str = "BCDEOFGEHB0E8F82" ;
    char[] str1 = new char[30];
    System.out.println("String value "+str); 
    n = str.length();
    System.out.println("String length "+n);
    if(n%2 == 0)
      {
      for(i=0;i<n;i++)
      {
         count = 0;
         val = val1;
         System.out.print("0x");
         for(i=val;i<val+2;i++)
            {
        count++;
          val1++;
                  if (count<=2)
                  {
                     str1[i] = str.charAt(i);
                  }
              System.out.print(str1[i]);
             }
             if(i<str.length())
            {
                 System.out.print(",");
             }
         }
     }
    else
     {
         System.out.println("please enter the correct even string value");
      }      
   }

}




Friday 20 January 2017

J2EE

Java History


  • 1996 - JDK 1.6
  • 1992 - *7 - Product a remote control
  • Green project restarted in collabration with Netscape and Sun Microsystem
  • in 1994 - first person
  • Applet was first interactive program on internet
Sun Microsystem

  1. Brought a browser "Not Java"
  2. 1996 - JDK 1.0
  3. In 1998 Sun Microsystem revealed 3 flavours.
1998 java
  • J2SE - Core Java
  • J2EE- Advanced Java
  • J2ME
JDK History
  • 2000 - JDK 1.3
  • 2002 - JDk 1.4
  • 2004 - JDK 1.5
  • 2006 - JDK 1.6
  • 2007 - JDK 1.7
  • 2014 - JDK 1.8
  • 2017 - JDK 1.9
Web application is done in J2EE
1998 - 1st open source technology

Introduction to Java EE
  • 2 from Java2EE is dropped after java1.5
Objective of the Session

Enterprise Software
  1. EAS(Enterprise Application Software) Group of people who came together for specific purpose on one application is known as EAS. Eg:- Facebook, Shopping site
  2. It can be any software that is accessing server for data solution.
EAS are expected to posses following characteristics
  1. Performance
  2. Scalability
  3. Robustness
  4. Security
  5. Reliability and Availability

Tuesday 17 January 2017

Two Highest elements in Array

Two Highest elements in Array

Output:
 enter the elements in array14
5
2
36
7
8
54
21
1
12
1452367854211121 2 5 7 8 12 14 21 36 54
 two highest element in array are 21 and 36
 and there sum is 57

Code:
#include<stdio.h>

int main()
{
int arr[20];
int i,j,n,temp = 0;
printf("\n enter the elements in array");
for(i=0;i<10;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<10;i++)
{
printf("%d",arr[i]);
}
for(i=0;i<10;i++)
{
for(j=0;j<10-i-1;j++)
{
if(arr[j]>arr[j+1])
{
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1]=temp;
}
}
}
for(i=0;i<10;i++)
{
printf("%d ",arr[i]);
}
printf("\n two highest element in array are %d and %d",arr[10-3],arr[10-2]);
printf("\n and there sum is %d",(arr[10-3]+arr[10-2]));
}

Monday 16 January 2017

2X2 Matrix

Program To Print 2X2 matrix

Output:

    Enter the values in matrix
88
99
44
55

 MATRIX REPRESENTATION
[  88  99]
[  44  55]

Code:
#include<stdio.h>

int main()
{
int arr[10][10]; //size of matrx
int i,j;
printf("\n  Enter the values in matrix \n");
for(i=0;i<2;i++) //size can be increased as per user req
{
for(j=0;j<2;j++)
{
scanf("%d",&arr[i][j]);
}
}
for(i=0;i<2;i++)
{
printf("[");
for(j=0;j<2;j++)
{
printf("  %d",arr[i][j]);
}
printf("]");
printf("\n");
}
}

Sunday 15 January 2017

Sum of two Number in C

Sum of Two numbers

Code:

#include<stdio.h>

int main()
{
     int num1,num2, sum;
     printf("\n Enter the number of your choice");
     scanf("%d%d",&num1,&num2);
     sum = num1 + num2;
     printf("\n Sum of two numbers %d and %d is  =  %d",num1,num2,sum);
     getch();
     return 0;
}

Palindrome number

To check number is palindrome or not

Output:

 Enter the number to check whether it is palindrome or not12321


 Number is palindrome 12321 = 12321

Code:

#include<stdio.h>

int main()
{
int rem,div,n,temp,sum =0;
printf("\n Enter the number to check whether it is palindrome or not");
scanf("%d",&n);
temp = n;
while(n!=0)
{
rem = n%10;
div = n/10;
sum = sum*10 + rem;
n = div;
}
if(sum == temp)
{
printf("\n Number is palindrome %d = %d ",temp,sum);
}
else
{
printf("\n Number is not palindrome %d != %d",temp,sum);
}
}

Rolls Royce

Rolls Royce
Amazing Cars

About Me