Tuesday, June 21, 2016

What is S.E.O and how to do keyword research | S.E.O training lecture 1 (introduction)

What is S.E.O ?
S.E.O stands for Search Engine Optimization.In simplest words S.E.O is a technique with which you can increase the traffic to your website or videos.
S.E.O can also be defined as the process of increasing the ranking of your website in any search engine like Google, Bing , Yahoo etc.

Categories of S.E.O:
There are two categories of S.E.O :
  • White Hat S.E.O
  • Black Hat S.E.O
We will be focusing on White Hat S.E.O.

Wednesday, April 20, 2016

Write a code in which keep taking marks from user until user enter a negative number and calculate grade and at end give total number of A,B,C,D,E and F grades.

In this question we are required to  create a program which we will keep taking marks from user until user enter a negative number and then calculate grade after every input .At end give total number of A,B,C,D,E and F grades.
So here is the JAVA code for solving that problem.

Tuesday, April 5, 2016

Example of While loop & Nesting of loops

Nesting of loops:
Nesting of loops mean using loop inside a loop.It could be "For" loop inside a "For" loop or a "For" loop inside a "While" loop or the other way round. 

Our Objective ?
Our objective is to write a JAVA program which keeps on taking values from user unless user give a prime number as input value.
We can easily solve this problem using nested loops.
We will use a "While" loop because we don't know when user will give a prime number as input value.

Sunday, April 3, 2016

Print out table of any number given by the user

As we have already studied about "For Loop" , now we will see some example codes for that.
if you haven't read that before then check out : Introduction to loop and its types .
For example if you want to print out table of any number , given by the user then you can use "For" loop for that process and the code will become:


package table;
import java.util.Scanner;

public class Table
{
    public static void main(String[] args)
    {
        Scanner input=new Scanner(System.in);
        System.out.print("Enter an integer: ");
        int a=input.nextInt();
        for(int i=1;i<=10;i++)
        {
            int b=a*i;
            System.out.println(a+" * "+i+"= "+b);
        }
        
    }
}



Introduction to loop and its types

Actually loop is a process of repeating the same process again and again without writing it multiple times.
For example if you want to take 50 inputs from user then you can use a loop to take those inputs by using the input statement only once.
The process of repeating the same thing again and again ( Loop ) is known as Iteration.
Types of Loop:

  • "For" Loop
  • "While" Loop
  • "Do While" Loop
"For" Loop:
"For" Loop is used when we know how many time iteration will be performed.For example if we know that we will take 50 inputs from user then we will use "For" Loop for that work .
Syntax for a "For" loops is:
for(int i=starting value;condition;increment or decrement)
{
    This is the body of loop.
}

"While" and "Do While" Loop:
"While" and "Do While" Loop is used when don't know how many times the iteration will be performed.For example if we know that we want to do the given process but we have no idea that how many times we will perform this thing then we use "While" or "Do While" loop.
Syntax for "While" loop is :
while(true/condition)
{
    this is the body of "while" loop.
    use a break statement to end the loop . It is recommended to use a break statement in a      condition.
}

Syntax for "Do-While" loop is:
do
{
   This is body of "Do-While" loop.
   
}while(condition);


Sunday, March 27, 2016

Check if given date is valid or not , using java coding



In order to check if the given date is valid or not you need to know the logic behind it.
  • During Leap year, February have 29 days.While generally February have 28 days in it.
  • April , June , September and November consists of 30 days.
  • While remaining months have 31 days in them.
We will be using only "if & else" conditions throughout the program coding.There is nothing else included in it.So let's get started.Here is the code for checking if given date is valid or not:


package labsessional;

import java.util.Scanner;
public class LabSessional
{
    public static void main( String [] args)
    {
        int day,month,year,leepYear ;
        Scanner input = new Scanner(System.in);
        System.out.print("Enter day : ");
        day=input.nextInt();
        System.out.print("Enter month: ");
        month=input.nextInt();
        System.out.print("Enter year: ");
        year=input.nextInt();
        leepYear=year%4;
       
    if(day>=1 && day<=31 && month>=1 && month<=12 && year>=1950 && year<=2099)
           
        {
            if (leepYear==0 && month==2 && day>=0 && day<=29)
                System.out.print("Your date is valid. ");
         else
         {
       
               
            if(month==4 || month==6 || month==9 || month==11 )
           
             {
                 if(day>=0 && day<=30)
                System.out.print("Your date is valid. ");
             else
                System.out.print("Your date is invalid. ");   
             }
   
            else if (month==2)
             {
                if(day>=0 && day<=28)
                    System.out.print("Your date is valid. ");
                else
                    System.out.print("Your date is invalid. ");
             }
             else if ( month==1|| month==3 || month==5 || month==7 || month==8 || month==10 || month==12)
              {
                  if(day>=0 && day<=31)
                      System.out.print("Your date is valid. ");
                  else
                      System.out.print("Your date is invalid. ");
              }
           
        }
    }
        else
            System.out.print("Your given date is invalid.");
 }
}


If you have any confusion or you found any error in our code , then please feel free to contact us . You can email us.Our email address is : k.ahmed2k19@gmail.com
If you liked it , then please share it with your friends. Keep visiting & Keep learning.

Saturday, March 26, 2016

Java code for finding Area Of a Circle



Here is the java code for finding the area of a circle.
You need to import "Scanner class", so that you can take input from user.That input will be radius of the circle.

package javaapplication2;
import java.util.Scanner;
public class JavaApplication2 
{
    public static void main(String[] args) 
    {
    double radius;
    double area;
    Scanner input=new Scanner(System.in);
    System.out.print("Enter Radius: ");
    radius=input.nextDouble();
    area = radius *radius * 3.14;
    System.out.println("The area of the circle of radius " + radius +" is " +area);
    
    }
    
}


If you found any error in this code or if you have a better and short java code for this work then please feel free to send it on our email so that we can upload it too.
Our contact email is :  K.ahmed2k19@gmail.com
If you like it then share it with your friends.Keep visiting and keep learning.