USE this pointer in your class! a) Write a C++ code to create emudrugstore class (emudrugstore.h) using the specifications provided above. Use appropriate (preferably short) names for data members and methods. b) Write a complete C++ code that will include the following steps to create main function (emudrugstore.cpp). • Include necessary header files, • Create a dynamic object that will execute the default constructor, Create another dynamic object that will execute the parameterized constructor, • Create a dynamic array object which stores data for 30 drugs, Call necessary method(s) o to set a new drug name for dobj1 object, (ex: panadol) to change the drug price of second dynamic object to 20.18, o to change the drug name of the object that is in the 3rd location of the array, (pass any drug name you want), o to display the drug serial number and the drug name of the object that is in the 5* location of the array, o to display drug name, drug price and drug serial number of the dynamic array object in row-wise, o to display the current values of total drug count and total drug price, Delete all objects you have created.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter13: Overloading And Templates
Section: Chapter Questions
Problem 22SA
icon
Related questions
Question
USE this pointer in your class!
a) Write a C++ code to create emudrugstore class (emudrugstore.h) using the specifications provided above. Use
appropriate (preferably short) names for data members and methods.
b) Write a complete C++ code that will include the following steps to create main function (emudrugstore.cpp).
• Include necessary header files,
• Create a dynamic object that will execute the default constructor,
• Create another dynamic object that will execute the parameterized constructor,
Create a dynamic array object which stores data for 30 drugs,
Call necessary method(s)
o to set a new drug name for dobj1 object, (ex: panadol)
to change the drug price of second dynamic object to 20.18,
to change the drug name of the object that is in the 3rd location of the array, (pass any drug name
you want),
o to display the drug serial number and the drug name of the object that is in the 5th location of the
array,
o to display drug name, drug price and drug serial number of the dynamic array object in row-wise,
o to display the current values of total drug count and total drug price,
Delete all objects you have created.
Transcribed Image Text:USE this pointer in your class! a) Write a C++ code to create emudrugstore class (emudrugstore.h) using the specifications provided above. Use appropriate (preferably short) names for data members and methods. b) Write a complete C++ code that will include the following steps to create main function (emudrugstore.cpp). • Include necessary header files, • Create a dynamic object that will execute the default constructor, • Create another dynamic object that will execute the parameterized constructor, Create a dynamic array object which stores data for 30 drugs, Call necessary method(s) o to set a new drug name for dobj1 object, (ex: panadol) to change the drug price of second dynamic object to 20.18, to change the drug name of the object that is in the 3rd location of the array, (pass any drug name you want), o to display the drug serial number and the drug name of the object that is in the 5th location of the array, o to display drug name, drug price and drug serial number of the dynamic array object in row-wise, o to display the current values of total drug count and total drug price, Delete all objects you have created.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning