Sunday, February 10, 2019

Match Making for you

Match making


Click above link to fill the form

Java program for String operations in swing





JAVA PROGRAM FOR String Operations in swing:



import java.awt.*;
import  java.lang.*;
import java.awt.event.*;
import javax.swing.*;

/*<applet code="StrOp" width=400 height=400></applet>*/

public class StrOp extends JApplet implements ActionListener
{
        JTextField text5;
       JTextField text4;
        JTextField text3;
       JTextField text2;
        JTextField text1;
        public void init()
        {
                Container contentPane=getContentPane();
                contentPane.setLayout(new GridLayout(5,2,40,40));
                JLabel enter=new JLabel("Enter String:");
                contentPane.add(enter);
                text1=new JTextField();
                contentPane.add(text1);
                JButton lower=new JButton("LOWER");
                lower.addActionListener(this);
                contentPane.add(lower);
                text2=new JTextField();
                contentPane.add(text2);
                JButton upper=new JButton("UPPER");
                upper.addActionListener(this);
                contentPane.add(upper);
                text3=new JTextField();
                contentPane.add(text3);
                JButton italic=new JButton("ITALIC");
         
                 italic.addActionListener(this);
                contentPane.add(italic);
                text4=new JTextField();
                text4.setFont(new Font("TimesNewRoman",Font.ITALIC,12));
                contentPane.add(text4);
                JButton bold=new JButton("BOLD");
                bold.addActionListener(this);
                contentPane.add(bold);
                text5=new JTextField();
                text5.setFont(new Font("TimesNewRoman",Font.BOLD,12));
                contentPane.add(text5);
       }
       public void actionPerformed(ActionEvent e)
       {
                String str=text1.getText();
                if(e.getActionCommand()=="LOWER")
                        text2.setText(str.toLowerCase());
                else if(e.getActionCommand()=="UPPER")
                        text3.setText(str.toUpperCase());
                else if(e.getActionCommand()=="ITALIC")
                        text4.setText(str);
                else if(e.getActionCommand()=="BOLD")
                        text5.setText(str);
       }
}












*****************************************



OUTPUT
*****************************************

Enter String     :  vijay

Lower              :  vijay

Upper              :  VIJAY
Italic                :  vijay
Bold                :   vijay

Java Program for Inheritance




JAVA PROGRAM FOR INHERITANCE:




import java.io.*;
 class Base
 {
     int a,b;
     void get( )
     {
         InputStreamReader ip=new InputStreamReader(System.in);
         BufferedReader br=new BufferedReader(ip);
         String ap;
         try
         {
            System.out.println("Enter Value of A:");
            ap=br.readLine( );
            a=Integer.parseInt(ap);

            System.out.println("Enter Value of B:");
            ap=br.readLine( );
            b=Integer.parseInt(ap);
           }
          catch(Exception e)
          {
            System.out.println(e);
           }
        }
    }
 class Derived extends Base
 {
    void disMin( )
    {
       if(a<b)
        System.out.println("Minimum Value is A:"+a);
       else
        System.out.println("Minimum Value is B:"+b);
       }
    void disMax( )
    {
       if(a>b)
         System.out.println("Maximum Value is A:"+a);
       else
         System.out.println("Maximum Value is B:"+b);
       }
   }
 class Inheritance
 {
   public static void main(String args[])
   {
      Derived dd=new Derived( );
      dd.get( );
      dd.disMin( );
      dd.disMax( );
    }
 }


*****************************************


OUTPUT:

*****************************************      
C:\vijay\advjava\jdk1.4\bin>java Base

Enter Value of A:
232
Enter Value of B:
236

Minimum Value is A:232
Maximum Value is B:236

C:\vijay\advjava\jdk1.4\bin>








Java program for square root




Java program for square root:



import java.awt.*;
import java.awt.event.*;
import java.io.*;

class SqRoot extends Frame implements ActionListener
 {
   TextField t1,t2;
   Label l1,l2;
   Button b1,b2;

   SqRoot()
   {
    setVisible(true);
    setTitle("Special Purpose Claculator");
    setSize(400,400);
  
      l1=new Label("Input no.");
      l2=new Label("Output");
    
      t1=new TextField(10);
      t2=new TextField(10);

      b1=new Button("Calculate");
      b2=new Button("Clear");
      b1.addActionListener(this);
      b2.addActionListener(this);

     Panel p1=new Panel( );
     p1.setLayout(new GridLayout(2,2));

     p1.add(l1);
     p1.add(t1);
     p1.add(l2);
     p1.add(t2);





     Panel p2=new Panel( );
     p2.setLayout(new FlowLayout( ));

     p2.add(b1);
     p2.add(b2);

     Panel p3=new Panel();
     p3.setLayout(new GridLayout(2,1));
     p3.add(p1);
     p3.add(p2);
    add(p3);

   }
  public void actionPerformed(ActionEvent ae)
  {
    try
    {
      if(ae.getSource( )==b1)
      {
        int n=Integer.parseInt(t1.getText( ));
        double y;
        y= Math.sqrt(n);
        t2.setText(""+y);
      }
   else
      {
        t1.setText("");
        t2.setText("");
     }
   }
     catch(Exception e)
     {
       System.out.println("Error..."+e);
        dispose( );
      }

  }
   public static void main(String args[])
   {
     SqRoot s=new SqRoot( );
     s.validate( );
   }
}

Java program for hash table


import  java.util.*;
import java.lang.*;
import java.io.*;
class   hashtable
{
        static Hashtable<String,Double> stud=new Hashtable<String,Double>();
              public  static void main(String args[])
        {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));               
                do                {
                        System.out.println("****************MENU*****************");
                        System.out.println("1:ACCEPT RECORD\n2:DISPLAY ALL                      RECORDS\n3:FIND HIGHEST\n4:EXIT");
                        System.out.println("\nEnter your choice:");
                        int ch=0;
                        try
                        {
                                ch=Integer.parseInt(br.readLine());
                        }
                        catch(IOException e)
                        {
                                System.out.println(e);
                        }
                        switch(ch)
                        {
                                case 1:
                                        accept();
                                        break;
                                case 2:
                                        displayall();
                                        break;
                                case 3:
                                        fhigh();
                                        break;
                             




                                    case 4:
                                        System.exit(0);
                                default:
                                        System.out.println("You entered wrong choice! TRY AGAIN!!");
                                        break;
                         }
               }while(true);
      }
               public static void accept()
               {
                        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                        String name="";
                        Double d=0.0;
                        System.out.println("Enter the name:");
                        try
                        {
                                name=br.readLine();
                                System.out.println("Enter the percentage:");
                                d=Double.parseDouble(br.readLine());
                        }
                        catch(IOException e)
                        {
                                System.out.println(e);
                        }

                        stud.put(name,d);
                }
                public static void displayall()
                {
                        Enumeration keys=stud.keys();
                        while(keys.hasMoreElements())
                        {
                                String key=(String)keys.nextElement();
                                System.out.println(key+"="+stud.get(key));
                        }
                }
                public static void fhigh()
                {
                      






                         Double max=0.0;
                        Enumeration keys=stud.keys();
                        while(keys.hasMoreElements())
                        {
                                String key=(String)keys.nextElement();
                                if(max<stud.get(key))
                                        max=stud.get(key);
                        }      
                        System.out.println("Highest Marks="+max);
                }
        
}
                       

*****************************************************************
OUTPUT
******************************************************************



Enter your choice:
1
Enter the name:
vijay
Enter the percentage:
71
****************MENU*****************
1:ACCEPT RECORD
2:DISPLAY ALL RECORDS
3:FIND HIGHEST
4:EXIT

Enter your choice:
1
Enter the name:
ajay
Enter the percentage:
77
****************MENU*****************
1:ACCEPT RECORD
2:DISPLAY ALL RECORDS
3:FIND HIGHEST
4:EXIT

Enter your choice:
1
Enter the name:
 atul
Enter the percentage:
81
****************MENU*****************
1:ACCEPT RECORD
2:DISPLAY ALL RECORDS
3:FIND HIGHEST
4:EXIT

Monday, February 4, 2019

Habits of all Successful People


Habits of all Successful People:


1. They Set GOALS.
2. They Take Responsibility For Their Life.
3. They Have Great Self Discipline
4. They Are Obsessed With Self Development
5. They Read. A LOT!
6. They Manage Their Time Well
7. They Take Risks!
8. They Keep Going When They Suffer Failure & Setbacks
9. They Find A Way To Win
10. They Do What They Love


"When you sweat  a lot in time of peace you bleed less in times of war."


Ten skills which are hard to Learn, but which will make you successful
1. Speaking up (Public Speaking)
2. Being honest with yourself
3. Having confidence
4. Listening
5. Managing your time
6. Stop whining
7. Staying present in the moment
8. Being consistent
9. Getting enough sleep
10. Having empathy 

Five Elements that lead to Success


Five elements that lead to Success are:

1: Idea

2: Team

3: Business Model

4: Funding

5: Timing




Timing is very essential to Success

Think what are you are going to get at the end of the process and happy sacrifice now knowing they will be rewarded latter .Keep Going.




What is Next JS?

 What is Next JS? Next.js is a powerful React framework developed by Vercel that simplifies building modern web applications. Its key featur...