Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Answer the following short questions. Your answer should be precise.

a)     Can we declare base class constructor or destructor as virtual if yes then why we want to do?

b)    How we can declare a class as abstract and why we need abstract classes? 

c)     Why we cannot able to create objects of abstract classes give reasonable justification of that.           



Write a program to print the following details

  • Assign and print the ID of each employee,
  • Phone number and Address of two staff members having names "ali" and "asif" respectively by creating two objects of the class 'Employee'.
  • throw an exception in case the phone number of employee is inserted in float , double or char value.
  • throw an exception in case the ID of an employee is inserted in float , double or char value.

Write a program to print the following details

  • Assign and print the ID of each employee,
  • Phone number and Address of two staff members having names "ali" and "asif"

respectively by creating two objects of the class 'Employee'.

  • throw an exception in case the phone number of employee is inserted in float ,

double or char value.

  • throw an exception in case the ID of an employee is inserted in float , double or

char value.


Assuming there is no error in main() complete the class Rectangle and its functions.

int main()

{

     Rectangle rect1(3.4, 5.68);

     Rectangle rect2(2.4, 4.68);

     if (rect1-- != ++rect2) //increment/decrement will add & subtract by 1 of each data members of class

           cout << ”\n Both are not of same size”;

     else

           cout << ”\n Both are of same size”;

     rect1.show(); \\will display values 2.4, 4.68      

     Rectangle rect3 = rect1 + rect2;

     rect3.show(); \\will display values 5.8, 10.36

     system(“pause”);

     return 0;

}



Write a program to print the following details

• Assign and print the ID of each employee,

• Phone number and Address of two staff members having names "ali" and "asif" respectively by creating two objects of the class 'Employee'.

• throw an exception in case the phone number of employee is inserted in float , double or char value.

• throw an exception in case the ID of an employee is inserted in float , double or char value.



Implement With C++ using class .

notes: candidate are 3 types . Use array andqueue, and priority is related with age.

Covid Vaccine registration booth:


1. frontline fighter

2. Citizen over 40 years

3. Student


Candidate info:

1.Name

2.Category

3.Registration no

4. Priority (age)

5. Age


Operation:

1. Registration

2. Show candidate list

3. Search candidate


a)    Can we declare base class constructor or destructor as virtual if yes then why we want to do?



You have been developing a small commercial Software for numeric operations. You are working on the calculation of areas and volume of different shapes. Based on your software complete these tasks:

Create a function template named as shape() that accepts three arguments in such a way that first and second will be the dimension like base and height and the third will be the name of the shape. The shape() function displays the dimension values and the area of the shape. The function returns the area to the calling program; the area is the same data type as the parameter. [Note: Design a main program such that, it input the values of only those shapes whose area is computable on the bases of base and height only]

Create another function template named as show_master()that accepts two arguments. The first is index and the second argument is an array of 10 values. The show_master() function will returns the specified index value.


there is no error in main () complete the class Rectangle and its functions.

Int main ()

{

     Rectangle rect1(3.4, 5.68);

     Rectangle rect2(2.4, 4.68);

     if (rect1-- != ++rect2) //increment/decrement will add & subtract by 1 of each data members of class

           cout << ”\n Both are not of same size”;

     else

           cout << ”\n Both are of same size”;

     rect1.show(); \\will display values 2.4, 4.68      

     Rectangle rect3 = rect1 + rect2;

     rect3.show(); \\will display values 5.8, 10.36

     system(“pause”);

     return 0;

}      


Assuming there is no error in main() complete the class Rectangle and its functions.

int main()

{

     Rectangle rect1(3.4, 5.68);

     Rectangle rect2(2.4, 4.68);

     if (rect1-- != ++rect2) //increment/decrement will add & subtract by 1 of each data members of class

           cout << ”\n Both are not of same size”;

     else

           cout << ”\n Both are of same size”;

     rect1.show(); \\will display values 2.4, 4.68      

     Rectangle rect3 = rect1 + rect2;

     rect3.show(); \\will display values 5.8, 10.36

     system(“pause”);

     return 0;

}



LATEST TUTORIALS
APPROVED BY CLIENTS