Monday, March 23, 2020

WEEK 8

QUESTION 1:// Declare a user-defined exceptionclass NegativeValException : public exception {     // LINE-1public:    virtual const char* what() const throw() {        return "Negative value";    }};// Declare a user-defined exceptionclass ZeroValException : public exception {         // LINE-2public:    virtual...

Wednesday, March 18, 2020

WEEK 7 ASSIGNMENT SOLUTION

GUYS I KNOW I WAS SUPER INCONSISTENT AND LATE IN UPLOADING THE SOLUTIONS BUT I WAS HAVING A BUSY TIME IN PAST FEW WEEKS(COLLEGE WORK ) , I AM NOT GIVING ANY EXCUSES BUT JUST LETTING YOU ALL GUYS KNOW WHAT WAS THE REASON DUE TO WHICH I AM UPLOADING VIDEOS SO LATE. AND THANKS FOR WATCHING MY STUFF.  QUESTION 1: import java.util.*; public class Question1{         public static...

Monday, March 16, 2020

WEEK 7 ASSIGNMENT SOLUTION

QUESTION 1:Container& operator =(int val) {      // LINE-1        this->arr[++i] = val;        return *this;    }    operator int()  {      // LINE-2        return arr[i--];    }};QUESTION 2:    virtual void print(int i)=0;         ...

Wednesday, March 11, 2020

WEEK 6 ASSIGNMENT SOLUTION

QUESTION 1: // Write the appropriate code to extend the Thread class to complete the class Question61. public class Question61 extends Thread{ public void run() {   System.out.print("Thread is Running."); } QUESTION 2: // Create main class Question62 with main() method and appropriate statements in it public class Question62{   public static void main(String[] args){     ThreadRun...

Saturday, March 7, 2020

WEEK 6 ASSIGNMENT SOLUTION

QUESTION 1:virtual void compute(){ n = n*n; }           // LINE-1       virtual void show(){ cout << n << endl; } // LINE-2};QUESTION 2:Base::f();          // LINE-1 Call proper function        cout << name << endl;    }    void g() {       ...

Wednesday, March 4, 2020

WEEK 5 ASSIGNMENT SOLUTION

QUESTION 1 : //Create a class A which implements the interface Number. class A implements Number {   public int findSqr(int i)   {     return i*i;   } } QUESTION 2:   //Create a class B, which implements the interface GCD. class B implements GCD {   public int findGCD(int a, int b)   {     if(b==0)       return a;    ...