Wednesday, May 26, 2021

Financial Year Oracle PLSQL Program

 CREATE OR REPLACE function FINANCIAL_YEAR(p_date DATE) return varchar2 IS

   v_first     varchar2(4);

   v_second    varchar2(4);

   v_year      varchar2(4);

   first_date  date;

   second_date date;

   third_date  date;

   four_date date;

   financial_year varchar2(9);

BEGIN


  v_year := to_char(p_date,'yyyy');

  first_date := to_date('01-APR-'||v_year);

  second_date := to_date('31-dec-'||v_year);

  

  third_date := to_date('01-JAN-'||v_year);

  four_date := to_date('31-MAR-'||v_year);

  

  IF p_date >= first_date AND  p_date <= second_date   THEN

        financial_year := to_char(v_year||'-'||to_number(v_year+1));

  END IF;

  

  IF p_date >= third_date AND  p_date <= four_date   THEN

        financial_year := to_char(to_number(v_year)-1||'-'||to_number(v_year));

  END IF;

 

  return financial_year;

END;

Monday, September 28, 2020

Java String Class and its method Program

 public class MyClass

{

    public static void main(String args[]) 

    {

       String a = new String("College");

        String b  = new String("Sushmit");

        String z  = new String("Sushmit");

        System.out.println("value of a -> " + a);

       System.out.println("value of b -> " + b);

       System.out.println("Converting string into upper case -> " + a.toUpperCase());

      

      String c = b.toUpperCase();

      System.out.println("Converting string into upper case -> " + c);

      

      boolean res;

      

      c = c.toLowerCase();

      System.out.println("Converting string into Lower case -> " + c);   

      c = a.replace('S','x');

      System.out.println("Converting string into Lower case -> " + c);   

      

      res = a.equals(b);

      System.out.println("Output is  -> " + res);  

      System.out.println("Output is  -> " + a.equals(b));  

      

      res = z.equals(b);

      System.out.println("Output is  equal -> " + res);  

      System.out.println("Output is  equal -> " + z.equals(b));  

      

      res = z.equalsIgnoreCase(b);

      System.out.println("Output is  Ignore Case -> " + res);  

      System.out.println("Output is  Ignore Case -> " + z.equalsIgnoreCase(b));  

      

      int count;

      count = z.length();

      System.out.println("Output is  Length -> " + count);    

      System.out.println("Output is  Length -> " + z.length());

      

      System.out.println("Output is  Length -> " + z.charAt(4));  

      

      

      count = b.compareTo(z);  

      System.out.println("Output is Compare to  -> " + count);  

      System.out.println("Output is  Compare to -> " + b.compareTo(z));     

      

      

      z = b.concat(z);  

      System.out.println("Output is Concate  -> " + z);  

      System.out.println("Output is  Concate -> " + b.concat(z));     

      

      System.out.println("Output is  SUbstring  -> " + a.substring(11));   

      System.out.println("Output is  SUbstring  -> " + a.substring(4,8));   

      

      

       System.out.println("Output is  Value of  -> " + String.valueOf(c));   

       System.out.println("Output is  Index of  -> " + a.indexOf('s'));   

       System.out.println("Output is  Index of  -> " + a.indexOf('s',3));   

        

    }

}



Wednesday, September 23, 2020

जावा - अस्थैतिक चर सदस्य


 इस क्रमादेश में तीन क्लास kaksha में तीन सदस्य चरों को घोषित किया गया है। इन्हे कन्स्ट्रक्टर के माध्यम से प्रारंभिकरण किया गया है। फलन show_data के माध्यम से निर्गत को स्क्रीन पर मुद्रित किया गया है। मेन फलन में kaksha  का अभिलक्ष्य बनाकर  show_data  फलन को निष्पादित किया गया है। इस क्रमादेष में सभी सदस्य अस्थैतिक है।


जावा क्रमादेश

-------------------------------------

class kaksha

{

   int admid;

   String name;

   String batch;

   public kaksha( int p_admid, String p_name, String p_batch )

    {       admid = p_admid;

            name = p_name;

            batch = p_batch;

     }

   public void show_data()

     {

       System.out.println("\n Admission ID -> " +  admid);

       System.out.println("\n Name -> " +  name);

       System.out.println("\n Batch -> " + batch);

     }

}

 

class main_class_2109

{

  public static void main(String args[])

   {

     kaksha  bca_2021= new kaksha(41730,"Prachi","2018-21");

     kaksha  bca_2022 = new kaksha(41702,"Ritika","2019-22");

     kaksha  bca_2023 = new kaksha(43460,"Ankita","2020-23");

     bca_2021.show_data();

     bca_2022.show_data();

     bca_2023.show_data();

   }

}

-----------------

 क्रमादेश में उपयोग किये गये 

अस्थैतिक चर एवं फलन की स्मृति संरचना


छात्र स्पष्ट रूप से देख सकतें है कि प्रत्येक अभिलक्ष्य ने स्वयं के चरों एवं फलनों हेतु स्मृति में व्यक्तिगत स्थान है। 


 


Friday, September 18, 2020

Student Class - Java Prorgram ( जावा क्रमादेश)

 class student

{

     int  admid; 

    String  name;

  String  course;

  String  batch;  

  public void get_data()

    { 

    admid = 43460;

    name  = "Ankita Sharma";

    course = "BCA";

    batch = "2018-2021";

 

  }


  public void show_data()

  { 

    System.out.println("admin id ->" + admid);

    System.out.println("\n name "+ name);

    System.out.println("\n Course "+ course);

     System.out.println(" \n Batch " + batch);

  }

}


class class_main

{

  public static void main(String args[])

  {

    student obj = new student();

    obj.get_data();

    obj.show_data();

  }

}


Tuesday, August 4, 2020

क्रमादेशन भाषा/संरचित पृच्छा भाषा पुस्तक की लिपि



CREATE TABLE vibhag
(   
  id         NUMBER(2,0),   
  naam       VARCHAR2(14),   
  sthan      VARCHAR2(13),   
  CONSTRAINTS pk_vibhag PRIMARY KEY (id)   
);

INSERT INTO vibhag(id,naam,sthan)
VALUES(10,'DHARM','KEDARNATH');
INSERT INTO vibhag(id,naam,sthan)
VALUES(20,'ARTH','SOMNATH');
INSERT INTO vibhag(id,naam,sthan)
VALUES(30,'KAAM','VISHWANATH');
INSERT INTO vibhag(id,naam,sthan)
VALUES(30,'MOKSHA','MAHAKAAL');




CREATE TABLE karmchari 
(   
  id             NUMBER(4,0),   
  naam           VARCHAR2(10),   
  karya          VARCHAR2(9),   
  adhikari       NUMBER(4,0),   
  pratham_dinank DATE,   
  vetan          NUMBER(7,2),   
  dastoor        NUMBER(7,2),   
  vibhagid       NUMBER(2,0),   
  CONSTRAINTS pk_karmchari PRIMARY KEY ( id),   
  CONSTRAINTS fk_vibhag FOREIGN  KEY (vibhagid) REFERENCES vibhag (id)   
);

INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid)
VALUES(7839,'OMKAR','ADHYAKSH',NULL,to_date('17-11-1981','dd-mm-yyyy'), 5000, NULL, 10 ); 
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid) 
VALUES(7698, 'BRAMHA', 'VYAVASTHAP', 7839,   to_date('1-5-1981','dd-mm-yyyy'),   2850, NULL, 30  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid) 
VALUES(7782, 'VISHNU', 'VYAVASTHAP', 7839,   to_date('9-6-1981','dd-mm-yyyy'),   2450, NULL, 10  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid)  
VALUES(7566, 'MAHESH', 'VYAVASTHAP', 7839,   to_date('2-4-1981','dd-mm-yyyy'),   2975, NULL, 20  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid) 
VALUES(7788, 'KASHYAP', 'MUNI', 7566,   to_date('13-JUL-87','dd-mm-rr') - 85,   3000, NULL, 20  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid) 
VALUES(7902, 'PARASHAR', 'MUNI', 7566,  to_date('3-12-1981','dd-mm-yyyy'),   3000, NULL, 20 );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid) 
VALUES(7369, 'VYAS', 'LIPIK', 7902,   to_date('17-12-1980','dd-mm-yyyy'),   800, NULL, 20  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid) 
VALUES(7499, 'MAHARISHIDAYANAND', 'PRACHARAK', 7698,   to_date('20-2-1981','dd-mm-yyyy'),   1600, 300, 30  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid)  
VALUES(7521, 'VIVEKANAND', 'PRACHARAK', 7698,   to_date('22-2-1981','dd-mm-yyyy'),   1250, 500, 30  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid)
VALUES(7654, 'KESHAV', 'PRACHARAK', 7698,   to_date('28-9-1981','dd-mm-yyyy'),   1250, 1400, 30  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid) 
VALUES(7844, 'MADHAV', 'PRACHARAK', 7698,   to_date('8-9-1981','dd-mm-yyyy'),   1500, 0, 30  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid) 
VALUES(7876, 'VALMEEKI', 'LIPIK', 7788,   to_date('13-JUL-87', 'dd-mm-rr') - 51,   1100, NULL, 20  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid) 
VALUES(7900, 'KAALIDAS', 'LIPIK', 7698,   to_date('3-12-1981','dd-mm-yyyy'),   950, NULL, 30  );
INSERT INTO karmchari(id,naam,karya,adhikari,pratham_dinank,,vetan, dastoor, vibhagid)
VALUES(7934, 'RAJSHEKHAR', 'LIPIK', 7782,   to_date('23-1-1982','dd-mm-yyyy'),   1300, NULL, 10  );

Tuesday, May 5, 2020

BSC - II Year - Question Bank (Object Oriented Programming Using C++/Java)

Subject: Object Oriented Programming Using C++/Java

QUESTION BANK
These question banks contain possible question set for each unit.  Questions are divided into two type i.e. short and long.  It is prepared for the shake of exam preparation only.

1.                 Unit – I:

1.1 Short Type Question:

1.                 Write Short note on Advantage of OOPS.
2.                 Explain C++ Program structure with block diagram.
3.                 Compare between Procedure Oriented Programming (POP) and
4.                 OOPS(Object Oriented Programming Languages).
5.                 Explain streams in C++.
6.                 Describe any three unformatted console input/output streams.
7.                 Explain any three formatted console input/output streams.
8.                 Explain different types of tokens.
9.                 Explain referencing and dereferencing operator.
10.            Explain Scope access operator and its application with program.
11.            write program in C++ to implement Fibonacci series.
12.            Write program in C++ to check whether given no prime or not.
13.           Write program in C++ to print palindrome of given integer number.

1.2 Long Type Question:

1.  Explain key concepts of Object Oriented Programming Concepts in Detail C++.
2.  Describe about Input/ Output Streams in C++ with example.
3.  Explain control statement in C++.
4.  Describe unformatted console input/output streams with programs.
5.  Explain formatted console input/output streams with programs.
Q.6 Explain any four
      a)  Referencing and dereferencing 
      b)  Scope Access Operator
      c)   Programming Paradigm in C++
      d)   Input Streams
      e)  Output Streams

Unit – II:

2.1 Short Type Question:

1.                 What is function in C++ explain with example.
2.                 Explain different types of function arguments in C++.
3.                 Differentiate between value, address and reference passing arguments in C++.
4.                 Explain  Inline function with example.
5.                 Explain inline function with its advantage and example.
6.                 Explain function overloading in C++
7.                 Write short note on class and object.
8.                 Explain access specifier in C++ classes.
9.                 Differential between Public, private, protected mode in C++.
10.            Explain static member function in C++ with Its advantage.
11.            Short note friend function and friend class.
12.            Explain constructor.
13.            What is destructor?
14.            Describe advantage of constructor.
15.            Explain overloading for constructor.
16.            Write program in C++ to implement constructor.
17.            Write a program in C++ to implement Static member function.

2.2 Long Type Question:

1.                 Explain Classes and object in detail with appropriate example.
2.                 Explain different type of function in C++.
3.                 Explain constructor and its type with example.
4.                 Explain constructor and destructor with example.
5.                 Explain any four
a)     Static Member Function
b)    Friend function and Friend Class
c)     Function Overloading
d)    Default Constructor
e)     Public, Private, Protected
f)      Inline function

Unit – III:

3.1 Short Type Question

1.                 Write short note on Inheritance.
2.                 Write short on Multiple Inheritance.
3.                 Write short note on  Multilevel Inheritance
4.                 Write short note on virtual Function
5.                 What is pure virtual function. Give an example.
6.                 What is virtual base class.
7.                 What is polymorphism.
8.                 What is static biding.
9.                 What is  late binding.
10.            What in hierarchical inheritance.
11.            What is pointer in C++.
12.            Explain protected inheritance.
13.            Explain private inheritance.
14.            Explain public inheritance.
15.            Explain unary operator overloading.
16.            Explain binary operator overloading.
17.            Explain operator overloading and its types.

3.2 Long Type Question

1.                 Explain Operator overloading with it types in detail.
2.                 Explain public, private and protected inheritance of class.
3.                 Explain inheritance and its types.
4.                 Explain polymorphis with static and dynamic binding.
5.                 Write a program in C++ to overload the operator + (Plus).
6.                 Write a program in C++ to overload the operator – (Minus) .
7.                 Write program in C++ to implement, multiple, hierarchical inheritance.
8.                 Explain pointers for array, class and object in C++.
9.                 Write short note on following
a)     Hybrid Inheritance
b)     Multipath inheritance
c)     Pure Virtual Function
d)    Virtual Function
e)     Pointer to Class
f)      Pointer to Object

 

Unit – IV:

4.1 Short Type Question

1.                 Write short note on program structure of java.
2.                 Explain Tokens in Java.
3.                 Explain Java virtual machine with diagram.
4.                 Explain constructor in java.
5.                 Explain method overloading in java.
6.                 Explain static member variable and method in java.
7.                 Explain Arrays and its type in Java.
8.                 Explain String class in java.
9.                 Explain Vector class in java
10.            Explain Wrapper class in java.
11.            Write short note on interface.
12.            Differentiate between java class and interface.
13.            Write short note on package.
14.            Write short note on system package.
15.            Write short note on user defined package.
16.            Why interface is used in Java.


4.2 Long Type Question

     1.     Compare between C++ and Java.
     2.     Explain Classes in Java with example.
     3.     Explain object oriented Programming in the context of Java.
     4.     Explain String class with any six string methods.
     5.     Explain packages with its types.
     6.     What is interface. Explain with example.
     7.     Explain Interface. Differential between Classes and Interfaces.
     8.     Explain Any Four following
a)     Java Virtual Machine
b)    Static Methods
c)     Constructor
d)    Overloading
e)     Vector
f)      Wrapper

Unit – V:

5.1 Short Type Question

1.                 Explain Inheritance.
2.                 Differentiate between overloading and overriding.
3.                 Explain final classes and final method.
4.                 Explain finalize method.
5.                 Explain abstract methods and Classes.
6.                 Explain visibility control.
7.                 Explain runnable interface.
8.                 Explain application of Applet.
9.                 Explain Thread Priority.
10.            Explain types of Applet.
11.            Describe advantage of Thread.
12.            Describe thread and multitasking operating system.
13.            Write a program to implement abstract method and class.
14.            Write a program to implement final method and class.

5.2 Long Type Question

1.                 Explain inheritance, its types with example in Java.
2.                 Explain applet life cycle with diagram.
3.                 What is Thread. Describe its life cycle.
4.                 Write program  in Java to show implement of Applet.
5.                 Write program  in Java to show implement of thread.
6.                 Explain any four
                    a)     Final Variable
                    b)    Abstract method
                    c)     Synchonization
                    d)    Method overriding
                    e)     Thread Priority.
  
References:

Text Books:
1.        Object-Oriented programming with ANSI & turbo C++ by Ashok N. Kamthane.
2. Object-Oriented programming in C++ by E.Balagurusamy
3.  E. Balaguruswamy, “Programming In Java”, 2nd Edition, TMH Publications ISBN 0-07- 463542
 Reference Books:
 C+ Object-Oriented programming in C++ by Robert Lafore.
 The complete reference by Herbert Schildt, TMH publication.


Blog: manishtiwarise.blogspot.com

YouTube Channel: manishtiwarise


Financial Year Oracle PLSQL Program

 CREATE OR REPLACE function FINANCIAL_YEAR(p_date DATE) return varchar2 IS    v_first     varchar2(4);    v_second    varchar2(4);    v_year...