We appreciate your visit to Declare a struct named PatientData that contains two integer data members named heightInches and weightPounds Sample output for the given program Patient data 63 in. This page offers clear insights and highlights the essential aspects of the topic. Our goal is to provide a helpful and engaging learning experience. Explore the content and find the answers you need!
Declare a struct named `PatientData` that contains two integer data members named `heightInches` and `weightPounds`.
Sample output for the given program:
```
Patient data: 63 in, 115 lbs
```
```cpp
#include
using namespace std;
/* Your solution goes here */
struct PatientData {
int heightInches;
int weightPounds;
};
int main() {
PatientData lunaLovegood;
lunaLovegood.heightInches = 63;
lunaLovegood.weightPounds = 115;
cout << "Patient data: " << lunaLovegood.heightInches << " in, "
<< lunaLovegood.weightPounds << " lbs" << endl;
return 0;
}
```
using namespace std;
/* Your solution goes here */
struct PatientData {
int heightInches;
int weightPounds;
};
int main() {
PatientData lunaLovegood;
lunaLovegood.heightInches = 63;
lunaLovegood.weightPounds = 115;
cout << "Patient data: " << lunaLovegood.heightInches << " in, "
<< lunaLovegood.weightPounds << " lbs" << endl;
return 0;
}
```