Sunday, 11 December 2022

E-Commerce Mind map diagrams [New Syllabus]

UNIT-1 :
UNIT 2 :

E-Commerce UNIT1.1 MIND MAP

 HISTORY OF E-COMMERCE & INDIAN BUSINESS CONTEXT


Saturday, 26 November 2022

Java program to perform different string manipulation.

 

package stringmanipulation;

 import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

 public class STRINGMANIPULATION {

        public static void main(String[] args) throws IOException {

         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

           System.out.println("Enter your choice");

          System.out.println("1. To use Length method of the String");

          System.out.println("2. To use indexof method the String");

          System.out.println("3. To use CharAt method of the String");

          System.out.println("4. To use CompareTO method of the String");

          System.out.println("5. To use Contain method of the String");

          System.out.println("6. To use endsWith method of the String");

          System.out.println("7. To use Repalce method of the String");

          System.out.println("8. To use tolowercase method of the String");

          System.out.println("9. To use touppercase method of the String");

          System.out.println("10. To use Concatenate method of the String");

 

          int choice=Integer.parseInt(br.readLine());

         

         switch(choice){

             case 1:

             System.out.println("Enter any String");

             String s1=br.readLine();

             System.out.println("Length of the given "+ s1+" String is ="+s1.length());

             break;

             case 2:

             System.out.println("Enter any String");

             String s2=br.readLine();

             System.out.println("Enter the character to find its position");

             String s3=br.readLine();

             System.out.println("String index starts from 0");

             System.out.println("Index of the given  "+ s3 +" String in string  "+s2+" is ="+s2.indexOf(s3));

             break;

             case 3:

             System.out.println("3. To use CharAt method of the String");

             System.out.println("Enter any String");

             String s4=br.readLine();

             System.out.println("Enter the position to find its character");

             int p=Integer.parseInt(br.readLine());

             System.out.println("Character at the given position " +p+" from the string "+s4+" is = "+s4.charAt(p));

             break;

             case 4:

             System.out.println("4. To use CompareTO method of the String");

             System.out.println("Enter any String");

             String s5=br.readLine();

             System.out.println("Enter any String to compare");

             String s6=br.readLine();

             System.out.println("Comparision value of string "+s5+" with string "+s6+" is = "+s6.compareTo(s5));

             break;

             case 5:

             System.out.println("5. To use Contain method of the String");

             System.out.println("Enter any String");

             String s7=br.readLine();

             System.out.println("Enter any String to find ");

             String s8=br.readLine();

             System.out.println("Contains string " + s8+" :"+s7.contains(s8));

             break;

             case 6:

             System.out.println("6. To use endsWith method of the String");

             System.out.println("Enter any String");

             String s9=br.readLine();

             System.out.println("Enter any character to check at suffix ");

             String s10=br.readLine();

             System.out.println("Ends with the char " + s10+" :"+s9.endsWith(s10));

             break;

             case 7:

             System.out.println("7. To use Repalce method of the String"); 

             System.out.println("Enter any String");

             String s11=br.readLine();

             System.out.println("Enter the substring to replace ");

             String s12=br.readLine();

             System.out.println("Enter the substring to replace with ");

             String s13=br.readLine();

             System.out.println("String after Replacement is "+s11.replace(s12, s13));

             break;

             case 8:

             System.out.println("8. To use tolowercase method of the String");

             System.out.println("Enter any String");

             String s14=br.readLine();

             System.out.println("Lowercase of the given string  "+s14+" is "+s14.toLowerCase());

             break;

             case 9:

             System.out.println("9. To use touppercase method of the String");

             System.out.println("Enter any String");

             String s15=br.readLine();

             System.out.println("Uppercase of the given string  "+s15+" is "+s15.toUpperCase());

             break;

             case 10:

             System.out.println("10. To use Concatenate method of the String");  

             System.out.println("Enter the first  String");

             String s16=br.readLine();

             System.out.println("Enter the second String");

             String s17=br.readLine();

             System.out.println("String after concatenation is "+s16.concat(s17));

             break;

             default:    

  System.out.println("Please select your choice between 1-10");

         }

    }

   }

OUTPUT :





 

Thursday, 24 November 2022

Java program to find simple and compound Interest using this keyword.

 

package usageofthis;

 import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

 class Interest{ 

int p; 

float r; 

int n;

double si;

double ci;

double tv;

Interest(int p,float r,int n){ 

this.p=p; 

this.r=r; 

this.n=n;

}

void simpleinterest(int p,float r,int n){

     si=(p * n * r)/100;

     tv= p +si;

}

void compoundinterest(int p1,float r1,int n1){

     ci=p1 * Math.pow(1+r1,n1);

     tv= p +ci;

}

void display1(){

    System.out.println("Principal = "+p);

    System.out.println("Interest Rate=  "+r);

    System.out.println("Time period= "+n);

    System.out.format("Simple Interest %.2f \n", si);

    System.out.format("Total Value %.2f \n ", tv);

    }

void display2(){

    System.out.println("Principal = "+p);

    System.out.println("Interest Rate=  "+r);

    System.out.println("Time period= "+n);

    System.out.format("Compound  Interest %.2f \n", ci);

    System.out.format("Total Value %.2f \n ", tv);

     }

}

public class Usageofthis {

       public static void main(String[] args) throws IOException {

                   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

                  

                    System.out.println("Enter the Principal amount");

                    int p = Integer.parseInt(br.readLine());

                   

                    System.out.println("Enter the Interest Rate in float");

                    float r = Float.parseFloat(br.readLine());

                   

                    System.out.println("Enter the Time Period in months ");

                    int n = Integer.parseInt(br.readLine());

                    Interest s1=new Interest(p,r,n);

                    System.out.println("Enter your choice ");

                    System.out.println("1.Simple Interest");

                    System.out.println("2.Compound Interest");

                    int choice = Integer.parseInt(br.readLine());

                    

                    switch(choice){

                        case 1:{

                           s1.simpleinterest(p, r, n);

                           s1.display1(); 

                           break;

                        }

                        case 2:{

                           s1.compoundinterest(p, r, n);

                           s1.display2(); 

                           break;

                        }

                        default:    

                        System.out.println("Please select your choice between 1& 2");

          

     }}

OUTPUT 1:












OUTPUT 2:





Java Program to find sum of n prime numbers

 

package sumofprimeno;

 

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

import java.util.logging.Level;

import java.util.logging.Logger;

  

public class Sumofprimeno {

 

       public static void main(String[] args) {

              try {

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

           

            System.out.println("Enter the value of n");

            int n = Integer.parseInt(br.readLine());

           

            int j,m=0,flag=0,sum=0;

           

             System.out.println("Enter any "+ n +" nos to check its prime or not");

             for(int i=1;i<=n;i++)

             {

             int a= Integer.parseInt(br.readLine());

             m=a/2;

             if(a==0||a==1){ 

               System.out.println(a+" is not prime number");     

             }else{ 

             for(j=2;j<=m;j++){     

             if(a%j==0){     

             System.out.println(a+" is not prime number");     

             flag=1;     

             break;     

             }     

        }     

             if(flag==0)  {

                 System.out.println(a+" is prime number");

                 sum=sum+a;

             } 

             }//end of else 

             }

             System.out.println("Sum of Prime Numbers=  "+sum);

        } catch (IOException ex) {

            Logger.getLogger(Sumofprimeno.class.getName()).log(Level.SEVERE, null, ex);

        }

        

    }

   

}

OUTPUT 1:










OUTPUT 2:










Wednesday, 23 November 2022

Java program to find area and perimeter of different shapes.

 Program:

package ar.peri;

 import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;


public class ArPeri {

   

    public static void main(String[] args) throws IOException {

      

       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

      

       System.out.println("Enter your choice");

       System.out.println("1. To find Area & Perimeter of a Rectangle");

       System.out.println("2. To Find Area & Perimeter of a Square");

       System.out.println("3. To Find Area & Perimeter of a Circle");

       System.out.println("4. To Find Area & Perimeter of a Equilateral Triangle");

       System.out.println("5. To Find Area & Perimeter of a  Parallelogram");

       System.out.println("6. To Find Area & Perimeter of a  Rhombus");

    

       int choice=Integer.parseInt(br.readLine());

      

       switch(choice){   

case 1:   

    //code to be executed for rectangle;

    System.out.println("You have selected to Find Area & Perimeter of a  Rectangle");

    System.out.print("Enter the value os side a ");

    int a =Integer.parseInt(br.readLine());

    System.out.print("Enter the value os side b ");

    int b =Integer.parseInt(br.readLine());

    int p1=2*(a+b);

    int area1=a*b;

    System.out.println(" Area = "+ area1 + " & Perimeter of a  Rectangle="+p1);

 break; 

case 2:   

 //code to be executed for square;  

    System.out.println("You have selected to Find Area & Perimeter of a  Square");

    System.out.print("Enter the value of side c ");

    int c =Integer.parseInt(br.readLine());

    int p2=4*(c);

    int area2=c * c;

    System.out.println(" Area = "+ area2 + " & Perimeter of a  Square="+p2);

 break;   

case 3:   

 //code to be executed for circle;  

  System.out.println("You have selected to Find Area & Perimeter of a Circle"); 

  System.out.print("Enter the radius ");

    int r =Integer. parseInt(br.readLine());

    float p3=(float) (2.0*3.14* r) ;

    float area3=(float) (3.14 * r* r);

    System.out.println(" Area = "+ area3 + " & Perimeter of a  Circle="+p3);

 break;   

 case 4:   

 //code to be executed for Equilateral Triangle ;  

      System.out.println("You have selected  to Find Area & Perimeter of a Equilateral Triangle");

      System.out.print("Enter the side ");

      int s =Integer. parseInt(br.readLine());

      int p4= 3* s ;

      float area4=(float)((1.0/4.0)*(Math.sqrt(3.0))* s*s );

      System.out.println(" Area = "+ area4 + " & Perimeter of a  Equilateral Triangle="+p4);

 break; 

 case 5:   

 //code to be executed for Parallelogram ;

     System.out.println("You have selected to Find Area & Perimeter of a  Parallelogram");

     System.out.print("Enter the side  a");

     int s1 =Integer. parseInt(br.readLine());

     System.out.print("Enter the side  b");

     int s2 =Integer. parseInt(br.readLine());

     int p5=2*(s1 + s2);

     int area5= s1 * s2;

     System.out.println(" Area = "+ area5 + " & Perimeter of a  Parallelogram="+p5);

     break;   

 case 6:   

 //code to be executed for   Rhombus; 

     System.out.println("You have selected to Find Area & Perimeter of a  Rhombus");

     System.out.print("Enter the side  a");

     int a6 =Integer. parseInt(br.readLine());

     System.out.print("Enter the side  height");

     int h =Integer. parseInt(br.readLine());

     int area6=a6 * h;

     int p6= 4 * a6;

      System.out.println(" Area = "+ area6 + " & Perimeter of a  Rhombus="+p6);

 break;  //optional 

 

default:    

  System.out.println("Please select your choice between 1-6");

}   

    }

   

}

OUTPUT 1:









OUTPUT 2: