AS

Trigger Key Assignment Solution

 Assignment::- Create trigger key for export vouchers in pdf . pdf file name must be same as voucher number. 

What is Trigger key in Tally? what the uses of this attribute?


 Trigger key के माध्‍यम से कम्‍प्‍यूटर द्वारा ऑटोमैटिक कीबोर्ड की कीज प्रैश करवाई जाती है जैसे कि कोई यूजर की बोर्ड पर कीज प्रैश करता हैै। 

/*Trigger Key

Auto Press Button on Behalf of user


Trigger Key, which sends the list of keys in 

sequence to the system as if an User/operator is 

pressing those Keys*/


For more information watch following video




 



 Assignment::- Create trigger key for export vouchers in pdf . pdf file name must be same as voucher number. वाउचर को पीडीएफ में एक्‍सपोर्ट करने के लिए एक की का निर्माण करें। लेकिन ध्‍यान रखे कि पीडीएफ फाइल का नाम ठीक वाउचर नंबर के समान ही होना चाहिये।

check below link for assignment answer


Download Sona Sarvan for rakshabandan/rakhi | बने बनाये सोना श्रवण डाउनलोड करें। राखी के लिए सोना श्रवण कैसे बनायें।


Steps:- 

Vmou Solved Question - Answer

Question Paper

Question. Paper-PGDCA/MSCCS-03/MCa-103/CPCJ | Oops Programming with C++ and Java

 

(i) in C++, the predefined object cout is an instance of which class?

Sol:- The predefined object cout is an instance of ostream class.

 

Question . Write a program in c++ to find the entered year is leap year or not.

Program start here

Question: Explain the concept of life cycle of an applet in java.

 

an applet is a special type of program embedded in the web page to generate dynamic content. Applet is a class in Java.

Question:Write a program in C++ using templates to find the maximum of two values.

 

/* C++ Program to find Largest among two numbers using function template */

Question : Explain the concept of inner classes with suitable examples in java.

 

Inner class(Non Static Nested Class) - a class within another class

Question : Explain the concept of file handling in c++ using suitable example. सी++ में फाइल हैण्डलिंग को उदाहरण सहित समझाइये?

we are using the iostream standard library, it provides cin and cout methods for reading from input and writing to output respectively.

Question: Explain the concept of checked and unchecked exceptions in java using suitable examples. चैक्ड व अनचैक्ड एक्सेंचप्शन को जावा में उदाहरण सहित बताइये।

 Types of Exception:-

Question:- Write a program in c++ to check the entered number by the user is prime or not.

Prime number is a number that is greater than 1 and divided by 1 or itself.  2, 3, 5, 7, 11, 13, 17, 19, 23.... are the prime numbers.

Question:- Write a program in Java to demonstrate the concept of multithreading using Runnable interface.

 Multithreading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilization of CPU. Each part of such program is called a thread. So, threads are light-weight processes within a process.

Question : - Describe the usage of any four methods in string class in Java. जावा में स्ट्रिंग क्‍लास के किन्‍हीं चार मैथडों के बारे में बताइए।

check this chart

Question:- Explain the usage of public, private and protected in java. जावा में पब्लिक, प्राइवेट व प्रोटेक्‍टेड के उपयोग का विवरण बताइये।


 

1.  The public Access Modifier (ठीक पब्लिक टॉयलेट की भांति)

old index list


 
TDL Index

Question- Describe the concept of constructors in java with suitable examples.

 

A constructor in Java is similar to a method that is invoked when an object of the class is created.

Question. Explain the concept of new and delete in C++. सी++ में न्‍यू एवं डिलीट कीवर्ड का विवरण दीजिए।


New Operator and Delete Operator

Question. Explain the purpose of using interfaces(सारांश) in java. जावा में इंटरफेस(सारांश) का उपयोग करने के उद्देश्य की व्याख्या करें।


1) To achieve security - hide certain details and only show the important details by using De-Coupling of an object (interface). So interface deals between client & Developers.

Question: Describe concept of multiple inheritance with suitable examples in c++. उपयुक्‍त उदाहरण के साथ सी++ में मल्‍टीपल इनहेरीटेंस को समझाइए?

Multiple Inheritance (A Class drived from Multiple classes अनेकों क्‍लासेस से बनी एक क्‍लास):- Multiple Inheritance in C++ allows a child class to inherit properties or behavior from multiple base classes. Therefore, it is the process that enables a derived class to acquire member functions, properties, characteristics from more than one base class. 

Question. Demonstrate any one binary operator overloading in c++ with suitable example.. C++ में बाइनरी ऑपरेटर ओवरलोडिंग को उदाहरण के साथ दर्शाइयें।


Ø Binary Operator overloading performed on objects for eg. Addition of two objects data members. बाइनरी ऑपरेटर ओवरलोडिंग को ऑब्‍जेक्‍ट के उपर कार्य करने के लिए उपयोग किया जाता है। जैसे दो ऑब्‍जेक्‍ट के डाटा मैम्‍बरर्स को जोडना

Q. 5. Why do we need to use constructor ? explain with suitable examples.


 

Q. 5. Why do we need to use constructor ? explain with suitable examples. 

Q. 4. What is a friend function in OOP? write a program in C++ to swap value of two different classes using the friend function?


 

Q. 4. What is a friend function in OOP? write a program in C++ to swap value of two different classes using the friend function? 

Sol. 

OOps Programming with C++ and JAVA , VMOU June-2021 Question 1


(i)Differentiate Exception and error?

Vmou june -2019 Question 1 Opps Programming with c++ and java


1. What do you mean by applets?

Question 7. What do you mean by function overloading? Explain with Examples. फंक्शन ओवरलोडिंग से आप क्या समझते हैं? उदाहरण सहित समझाइए।


 

Multiple functions with same name is known as function overloading or function polymorphism.

Question 9. What is exception handling? What are the types of exceptions? Write a code to handle array out of bound exceptions. अपवाद हैंडलिंग क्या है? अपवाद कितने प्रकार के होते हैं? Array out of bound अपवाद को संभालने के लिए एक कोड लिखें।


Exception handling mechanism describes the behavior of program when exception occurs. Exception handling is a very powerful technique by which runtime errors are handled. There are two ways of handling exceptions: programmer defined exception handling and default exception handling.

अपवाद प्रबंधन तंत्र, अपवाद होने पर Program(Software Code) के व्यवहार का वर्णन करता है। Exception Handling एक बहुत ही शक्तिशाली तकनीक है जिसके द्वारा runtime errors को handle किया जाता है। जिससे program का normal flow बना रहता है। अपवादों को संभालने के दो तरीके हैं: प्रोग्रामर परिभाषित अपवाद हैंडलिंग और डिफ़ॉल्ट अपवाद हैंडलिंग।


Types of Exception:-

There can be two types of built-in exception classes namely, checked exceptions and unchecked exceptions. Programmer needs to explicitly mention about handling of checked exceptions in the program where as not necessarily about unchecked exceptions.

दो प्रकार के अंतर्निर्मित अपवाद Class हो सकते हैं,  अर्थात् चेक किए गए अपवाद और अनियंत्रित अपवाद। प्रोग्रामर को प्रोग्राम में चेक किए गए अपवादों को संभालने के बारे में स्पष्ट रूप से उल्लेख करने की आवश्यकता होती है। जबकि अनियंत्रित अपवादों के लिए यह आवश्‍यक नही है।

 

Checked Exception

Checked exceptions are either handled by the method that generate them using a pair of keyword try and catch or it may be explicitly declared using keyword throws. Hence, compiler checks these exceptions. Below table shows some exception conditions and their corresponding checked exception classes.

Checked Exceptions को या तो ट्राई व कैच कीवर्ड का उपयोग करके नियंत्रित किया जा सकता है या फिर स्‍पष्‍ट रूप से थ्रो कीवर्ड का उपयोग करके नियंत्रित किया जा सकता है। इसलिए,  कंपाइलर इन अपवादों की जाँच करता है। नीचे दी गई तालिका कुछ अपवाद स्थितियों और उनके संबंधित Checked Exception क्‍लास को दिखाती है।

 

S.No.

Condition

Checked Exception

1.

Class Not Found

ClassNotFoundException

2.

Clone not supported

CloneNotSupportedException

3.

Illegal access to a class

IllegalAccessException

4.

Instantiation not allowed

InstantiationException

5.

Interrupted by thread

InterruptedException

6.

Field not found

NoSuchFieldException

7.

Method does not exist

NoSuchMethodException

 

UNCHECKED Exception

Unchecked exceptions occur at run time and are not checked by compiler. Programmer is not compelled to write exception handler for them rather it is optional. Below table shows some common exception conditions and their corresponding unchecked exception classes.

अनियंत्रित अपवाद रन टाइम पर होते हैं और कंपाइलर द्वारा चेक नहीं किए जाते हैं। प्रोग्रामर उनके लिए अपवाद हैंडलर लिखने के लिए बाध्य नहीं है बल्कि यह वैकल्पिक है। नीचे दी गई तालिका कुछ सामान्य अपवाद स्थितियों और उनके संबंधित Unchecked Exception क्‍लास को दिखाती है।

S.No.

Conditions

Unchecked Exception

1

Divide by zero

ArithmeticException

2

Array index out of bounds

Array Index Out Of Bounds Exception

3

Not in a number format

NumberFormatException

4

Improper type array storage

ArrayStoreException

5

Invalid cast

ClassCastException

6

Illegal argument type

IllegalArgumentException

7

Negative array size

NegativeArraySizeException

8

Invalid use of null pointer

NullPointerException

 

 

Code to handle array out of bound exceptions

 

public class Main {
   public static void main (String args[]) {
      int array[] = {20,20,40};
      int num1 = 15, num2 = 10;
      int result = 10;
      try {
         result = num1/num2;
         System.out.println("The result is" +result);
         for(int i = 5; i >= 0; i--) {
            System.out.println("The value of array is" +array[i]);
         }
      } catch (ArrayIndexOutOfBoundsException e) {
         System.out.println("Array is out of Bounds"+e);
      } catch (ArithmeticException e) {
         System.out.println ("Can't divide by Zero"+e);
      }
   }
}
 
Output
 
The result is1
Array is out of Boundsjava.lang.ArrayIndexOutOfBoundsException : 5

 


 


Fast Index