Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, can someone help Take a look at the attached file structConversion.c . Use the following struct template named Person in the program. Modify the

Hello, can someone help

Take a look at the attached file structConversion.c.

Use the following struct template named Person in the program. Modify the following two functions as follows.

void printData(struct person x); struct person readData(); Replace gets with fgets.

You can use any additional helper functions. Submit the complete file as structConversionLab5.c file.

here is the code "

#include

#include

void readData(char name[], char ssn[], int* age, float *height, float *weight){

char buff[BUFSIZ];

gets(name);

gets(ssn);

*age = atoi(gets(buff));

*height = atof(gets(buff));

*weight = atof(gets(buff));

}

void printData(char name[], char ssn[], int age, float height, float weight){

printf("%s %s Age = %d Height(cm) = %g Weight(kg) = %g ", name, ssn, age, height, weight);

}

int main(){

char name[BUFSIZ];

char ssn[BUFSIZ];

int age;

float height;

float weight;

printf("Reading data ...... ");

readData(name, ssn, &age, &height, &weight);

printf(" ");

printf("Printing data .... ");

printData(name, ssn, age, height, weight);

return 0;

}"

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain the nature of human resource management.

Answered: 1 week ago

Question

Write a note on Quality circles.

Answered: 1 week ago

Question

Describe how to measure the quality of work life.

Answered: 1 week ago