- 1 Declare A Struct Called Empinfo That Contains String Name String Id Double Reviews And Double Average 2 Declar 1 (32.61 KiB) Viewed 35 times
1. Declare a struct called Empinfo that contains: string name, string id, double "reviews, and double average. 2. Declar
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
1. Declare a struct called Empinfo that contains: string name, string id, double "reviews, and double average. 2. Declar
1. Declare a struct called Empinfo that contains: string name, string id, double "reviews, and double average. 2. Declare a pointer to the Empinfo struct called employees. 3. Allocate memory on the heap (dynamically allocate memory for an array) for 10 Empinfo structs and make employees to point at the start of the array. Make sure to allocate memory for 4 review scores for each element of the employees array. 4. Assume that the array is populated, that is all the elements have valid values stored in them (that is there is no need for any input). Write a function called calcAverage() that takes employees array and its size as arguments, and calculates the average review score of each employee.