Question

A health care issue that has been in the news lately is the computerization of health...

A health care issue that has been in the news lately is the computerization of health records. This possibility is being approached cautiously because of sensitive privacy and security concerns, among others. Computerizing health records could make it easier for patients to share their health profiles and history among their various health care professionals. This could improve the quality of health care, help avoid drug conflicts and erroneous drug prescriptions, reduce costs and in emergencies could save lives. In this exercise, you will design a “starter” HealthProfilestructure for a person. The structure’s members should include the person’s first name, last name, gender, height (in inches) and weight (in pounds).

Your program will create an array of HealthProfile structure for up to 30 people. The user will enter the information and store them into the array of HealthProfile structure. Your program will display the information in a tubular format with values aligned properly.

Then, write a function to calculate the average of the weight.

    struct healthProfile {

        char first[15];

        char last[15];

        char gender[1];

           int height; // in inches

        int weight; // in pounds

    };

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

#include <stdio.h>

struct healthProfile {

char first[15];

char last[15];

char gender[1];

int height; // in inches

int weight; // in pounds

};

double calcAvgWeight(struct healthProfile profiles[], int n);

int main(){

struct healthProfile profiles[30];

int n, i;

printf("How many profiles would you like to add(max 30): ");

scanf("%d", &n);

for(i=0; i<n; i++){

printf("Profile %d:\n", i+1);

printf("First Name: ");

scanf("%s", profiles[i].first);

printf("Last Name: ");

scanf("%s", profiles[i].last);

printf("Gender: ");

scanf("%c", &profiles[i].gender[0]);

printf("height: ");

scanf("%d", &profiles[i].height);

printf("weight: ");

scanf("%d", &profiles[i].weight);

}

printf("%-15s %-15s %-6s %-10s %-10s\n", "Firstname", "Lastname", "gender", "height", "weight");

for(i=0; i<n; i++){

printf("%-15s %-15s %-6c %-10d %-10d\n", profiles[i].first, profiles[i].last, profiles[i].gender[0], profiles[i].height, profiles[i].weight);

}

printf("Average weight: %.2lf", calcAvgWeight(profiles, n));

return 0;

}

double calcAvgWeight(struct healthProfile profiles[], int n){

double avg = 0.0;

int i;

for(i=0; i<n; i++){

avg += profiles[i].weight;

}

avg /= n;

}

Add a comment
Know the answer?
Add Answer to:
A health care issue that has been in the news lately is the computerization of health...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please write this code in C++ Object-Oriented Programming, specify which files are .h, and .cpp, and...

    Please write this code in C++ Object-Oriented Programming, specify which files are .h, and .cpp, and please add comments for the whole code. Include a class diagrams, and explain the approach you used for the project and how you implemented that, briefly in a few sentences. Please note the following: -Names chosen for classes, functions, and variables should effectively convey the purpose and meaning of the named entity. - Code duplication should be avoided by factoring out common code into...

  • Title: Partners Health Care Systems (PHS): Transforming Health Care Services Delivery through Information Management According to...

    Title: Partners Health Care Systems (PHS): Transforming Health Care Services Delivery through Information Management According to government sources, U.S. expenditures on health care in 2009 reached nearly $2.4 trillion dollars ($2.7 trillion by the end of 2010).[1] Despite this vaunting national level of expenditure on medical treatment, death rates due to preventable errors in the delivery of health services rose to approximately 98,000 deaths in 2009.[2] To address the dual challenges of cost control and quality improvement, some have argued...

  • C Programming write two functions, similar to what you see in the sample program. The first will ask the user to enter some information (I have included the type in parentheses) First Name (char[]) L...

    C Programming write two functions, similar to what you see in the sample program. The first will ask the user to enter some information (I have included the type in parentheses) First Name (char[]) Last Name (char[]) Age (int) Height in Inches (double) Weight in Pounds (double) You will use pass-by-reference to modify the values of the arguments passed in from the main(). Remember that arrays require no special notation, as they are passed by reference automatically, but the other...

  •                                           &nb

                                                                                            “Baby names and birth weights” Introduction Babies are weighed soon after birth and this birth weight is recorded as part of a baby’s medical record. A low birth weight indicates increased risk for complications and such babies are given specialized care until they gain weight. Public health agencies, such as the Centers for Disease Control and Prevention (CDC) in the United States, keep records of births and birth weights. In this project you will write principled object-oriented C++ code...

  • The administration of President Barack Obama has made Patient Protection and Affordable Care Act, often called...

    The administration of President Barack Obama has made Patient Protection and Affordable Care Act, often called “Obamacare”, its chief domestic accomplishment and the centerpiece of Obama’s legacy. Essential to Obama’s health care reform plan is Healthcare.gov, a health insurance exchange Web site that facilitates the sale of private health insurance plans to U.S. residents, assists people eligible to sign up for Medicaid, and has a separate marketplace for small businesses. The site allows users to compare prices on health insurance...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT