Willem and his friends organized a blood donation camp with the help of a rotary club. The main aim of the camp is to create a database consisting of all the donor details and this can be used in the future during emergencies. Write a program to get the details of n donors like Name, age, height weight, gender, and blood group and display all the donor details. 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.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Modularization Techniques
Section: Chapter Questions
Problem 19RQ
icon
Related questions
Question

QUESTION PROVIDED IN ATTACHED IMAGE KINDLY SEE. PROVIDE OUTPUT AS IT IS SHOWN IN QUESTION.

 

AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , donor.cpp  )

----------------- TEMPLATES BELOW FOR SOLUTION -----------------------

 

main.cpp

#include <iostream>
#include<string>
#include<stdio.h>
#include "Donor.cpp"
using namespace std;
int main()
{
int n;
cout<<" Enter the number of donors:\n";
cin>>n;
//Fill the code
}

 

 

Donor.cpp

#include <iostream>
#include<stdio.h>
#include<string>
using namespace std;
class Donor
{
public:
string name;
int age;
float height, weight;
string gender, bloodGroup;

void display(Donor obj[], int n)
{
cout<<"Donor details in the hospital database :"<<endl;
//Fill your code
}
};
Willem and his friends organized a blood donation camp with the help of a
rotary club. The main aim of the camp is to create a database consisting of all
the donor details and this can be used in the future during emergencies.
Write a program to get the details of n donors like Name, age, height weight,
gender, and blood group and display all the donor details.
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 attributes.
Data Type
string
Variable Name
name
int
float
float
string
string
age
height
weight
gender
bloodGroup
Include the following member function in Donor class
Member Function
void display(Donor obj[], int n)
Description
This method must display the donor details.
In the main method, get the details of n number of donors and display all the
donor details.
Input and Output Format:
Refer to the sample input and output for formatting specifications.
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output 1:
Enter the number of donors:
2
Enter the donor details1
Enter the name:
Aarav
Enter the age:
24
Enter the height:
156.9
Enter the weight:
45.9
Enter the gender:
male
Enter the Blood Group:
B+
Enter the donor details2
Enter the name:
Taj
Enter the age:
34
Enter the height:
134.5
Enter the weight:
56.7
Enter the gender:
male
Enter the Blood Group:
AB+
Donor details in the hospital database:
Donor1
Name :Aarav
Age :24
height:156.9
weight:45.9
Gender :male
Blood Group :B+
Donor2
Name :Taj
Age :34
height:134.5
weight :56.7
Gender :male
Blood Group :AB+
Sample Input and Output 2:
Enter the number of donors:
1
Enter the donor details1
Enter the name:
Vasili
Enter the age:
24
Enter the height:
145.6
Enter the weight:
34.5
Enter the gender:
female
Enter the Blood Group:
B+
Donor details in the hospital database :
Donor1
Name :Vasili
Age :24
height:145.6
weight:34.5
Gender :female
Blood Group :B+
Transcribed Image Text:Willem and his friends organized a blood donation camp with the help of a rotary club. The main aim of the camp is to create a database consisting of all the donor details and this can be used in the future during emergencies. Write a program to get the details of n donors like Name, age, height weight, gender, and blood group and display all the donor details. 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 attributes. Data Type string Variable Name name int float float string string age height weight gender bloodGroup Include the following member function in Donor class Member Function void display(Donor obj[], int n) Description This method must display the donor details. In the main method, get the details of n number of donors and display all the donor details. Input and Output Format: Refer to the sample input and output for formatting specifications. [All text in bold corresponds to input and the rest corresponds to output] Sample Input and Output 1: Enter the number of donors: 2 Enter the donor details1 Enter the name: Aarav Enter the age: 24 Enter the height: 156.9 Enter the weight: 45.9 Enter the gender: male Enter the Blood Group: B+ Enter the donor details2 Enter the name: Taj Enter the age: 34 Enter the height: 134.5 Enter the weight: 56.7 Enter the gender: male Enter the Blood Group: AB+ Donor details in the hospital database: Donor1 Name :Aarav Age :24 height:156.9 weight:45.9 Gender :male Blood Group :B+ Donor2 Name :Taj Age :34 height:134.5 weight :56.7 Gender :male Blood Group :AB+ Sample Input and Output 2: Enter the number of donors: 1 Enter the donor details1 Enter the name: Vasili Enter the age: 24 Enter the height: 145.6 Enter the weight: 34.5 Enter the gender: female Enter the Blood Group: B+ Donor details in the hospital database : Donor1 Name :Vasili Age :24 height:145.6 weight:34.5 Gender :female Blood Group :B+
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Linux
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,