ABC Blood bank wished to welcome and thank all their eligible donors as a symbol of respect. Write a C++ program to welcome and thank all their eligible donors using an explicit call destructor. Strictly adhere to the Object-Oriented Specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. The class Donor has the following public data members. Data Type string Variable Name name age height weight no_of_units_donated int float float int Create a default constructor to display the message "Welcome to the Blood Bank". Check if the donor is eligible to donate the blood using a destructor. • If the age of the donor is above 18 years, then he is eligible, so display the message "Thank you for donating the Blood". • If the age of the donor is less than or equal to 18 years, then he is not eligible, so display the message "You are not eligible to donate the blood". Include the following member function in Donor class Description This method must display the donor details. Display the statement 'Donor details:' inside this method. Member Function void display() In the main method, get the donor details, display the details of the donor by calling display method ane display whether he is eligible or not using destructor.
1) QUESTION PROVIDED IN ATTACH IMAGE KINDLY SEE.
2) IF THERE IS A DECIMAL IN OUTPUT WHETHER IT'S ZERO OR TWO PLACE DECIMAL YOU MUST MATCH AS IT IS WITH QUESTION OUTPUT NO MISMATCH IN OUTPUT ACCEPTED
AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , donor.cpp )
----------------- TEMPLATES BELOW FOR SOLUTION -----------------------
Main.cpp
#include<iostream> int main()
|
Donor.cpp
#include<iostream> class Donor public:
} |
Step by step
Solved in 3 steps with 4 images