Write a program of constructors and destructors, C/C++ Programming

Assignment Help:

Write a program of constructors and destructors

Make a class drugs having encapsulated data for medicine name, whether solid or liquid, price and purpose of use. From this class derive two classes, Ayurvedic and Allopathic. The class Ayurvedic should additionally store data on the herbs used, association to be used (whether honey or water). The class Allopathic should additionally include data on the chemicals used and the weight in milligrams. The classes should have constructors and destructors. They should contain functions to accept data and display the data. The main () should test the derived classes.

 


Related Discussions:- Write a program of constructors and destructors

Loop, Write a program that writes your name on the monitor ten times. Write...

Write a program that writes your name on the monitor ten times. Write this program three times, once with each looping method.

If i wish a local to "die" before the close} of the scope, What if I wish a...

What if I wish a local to "die" before the close} of the scope wherein it was created? Can I call a destructor on a local if I want to?

Can a copy constructor admit an object of the similar class , Can a copy co...

Can a copy constructor admit an object of the similar class as parameter, rather than reference of the object?

Function, write a function named "fact"that takes one integer arguments,ca...

write a function named "fact"that takes one integer arguments,call them "num" and returns as ..............

Solution, 3 . Write a ‘C’ program to accept any 3 digit integer numb...

3 . Write a ‘C’ program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

PEBBLE MERCHANT, C CODE FOR PEBBLE MERCHANTS PROBLEM

C CODE FOR PEBBLE MERCHANTS PROBLEM

When i develop a destructor, When I develop a destructor, do I require to e...

When I develop a destructor, do I require to explicitly call the destructors for my member objects?

Padovan string, #question:-program to counts tha no of occurances of the st...

#question:-program to counts tha no of occurances of the string in the nth padovan string

Priority Queue, Ask question #Minimum 100 words acceptedEducational Objecti...

Ask question #Minimum 100 words acceptedEducational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms i

Time table, programme for time table in c++

programme for time table in c++

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd