Consider the following structure definition and solve the following problems. 1. Write a C program that will read all the information from a file named “mobileInfo.txt” and initialize the SmartPhone type array. 2. Write a function that will find all the devices from a specific country and print the information using the function printMobileInfo. call the printMobileInfo from countryWisePhone function. Use the prototypes below -void countryWisePhone( SmartPhone mobileList[], int size, char *country); void printMobileInfo(SmartPhone mobile); 3. Write a function that will print all the information in the main of a specific smart phone and delete all the information from the file and update that file. Use the function prototype – void deletePhone( SmartPhone mobileList[], int size, SmartPhone *highestPricePhone, int phoneID);
Transcribed Image Text:Consider the following structure definition and solve the following problems. 1.
Write a C program that will read all the information from a file named
"mobilelnfo.txt" and initialize the SmartPhone type array. 2. Write a function that
will find all the devices from a specific country and print the information using
the function printMobilelnfo. call the printMobilelnfo from countryWisePhone
function. Use the prototypes below -void countryWisePhone( SmartPhone
mobileList[], int size, char *country); void printMobilelnfo(SmartPhone mobile); 3.
Write a function that will print all the information in the main of a specific smart
phone and delete all the information from the file and update that file. Use the
function prototype - void deletePhone( SmartPhone mobileList[], int size,
SmartPhone *highestPricePhone, int phonelD);
typedef struct {
int phoneID; // unique ID
char phoneName[50];
int price;
int ramMemory;
float cpuSpeed;
int gpuMemory;
char userName[50];
char userEmail[50];
char usercountry[50];
} SmartPhone;
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.