Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

-Write the declaration statement for an array of web information records called

ID: 3637451 • Letter: #

Question

-Write the declaration statement for an array of web information records called “Blog_Static”. Let the capacity of “Blog_Static” be 10. Name a web information record “web_record”. Remember to include a declaration statement for “web_record”. Each record will have 4 fields which are defined as follows:
a. a string field called “address”;
b. an integer field called “length”;
c. a character array field called “owner”;
d. a decimal field called “rate” rounded to the nearest hundredths.

- Write a declaration statement for a dynamic array of “web_record”s called “Blog_Dynamic” that has a capacity of CAPACITY. Write all necessary statements for memory allocation, variable declarations and constant declaration.

-Write the function prototype for a void function called “Print” that has three formal parameters: an array called “Blog_Dynamic”, an integer called “count”, and an integer constant called “CAPACITY”.

- Using any necessary information from previous, implement the function Print which prints all the contents of Blog_Dynamic to the default standard output stream. “count” is the number of records in “Blog_Dynamic” and “CAPACITY” is the total number of records/cells allocated to “Blog_Dynamic”. Your output should contain a title and be nicely formatted. The function Print should contain a function header that includes: a function name, description, precondition and post condition.

- Declare a user type called “Array_Type” for an array with the same characteristics as ”Blog_Dynamic”, and declare an array called “myNew_Array” of this new type.

-Implement a function called “Sum_Up” that returns an Array_Type. Sum_Up has two formal parameters of type Array_Type called “Blog1” and “Blog2”. Assume the arrays, Blog1 and Blog2, are both full to capacity. Sum_Up allocates space for a new “Array_Type” . The values stored in each cell in the new “Array_Type” will be the sum of the corresponding cells in Blog1 and Blog2. Note: copy the corresponding values in Blog1’s address and owner fields to the corresponding fields in new array, and the sum of the length and rate fields of Blog1 and Blog2 will be stored in the corresponding length and rate filed in the new array.

Explanation / Answer

struct blog-static { struct web-record; }; struct blog-static member[10]; struct web-record{ { char address[100]; int length; float rate; char owner[10]; };