Question: Structure Name Fields Functionality Calculator double (**operations) (int,int) Holds a list of function pointers to math operations. (typedef Calculator) int **data Holds the operational data

 Structure Name Fields Functionality Calculator double (**operations) (int,int) Holds a list

Structure Name Fields Functionality Calculator double (**operations) (int,int) Holds a list of function pointers to math operations. (typedef Calculator) int **data Holds the operational data from an input file. int operation Count Holds the total number of operations in the Calculator. int dataLength Holds the total number of data points from the input file. Your calculator program must include the following functions: Requirement Conditions Function Calculator* create_calculator (double (**)(int,int), int) Input Parameters An array of function pointers representing math operations and the length of that array. Return Value An initialized Calculator. Notes An initialized Calculator has no data. The operations and operation count should be saved. Requirement Conditions Function bool load calculator_data(Calculator*, char*) Input Parameters A pointer to a Calculator and a string representing a file name. Return Value Return true if data is successfully read and stored in the calculator. Otherwise false. Notes This function should read the data from the provided file and store it in the Calculator. Requirement Conditions Function void run calculator(Calculator*) Input Parameters A pointer to a Calculator. Return Value None. Notes This function should perform all of the operations in order and print them to stdout. Requirement Conditions Function bool destroy calculator(Calculator*) Input Parameters A pointer to a Calculator. Return Value Return true if the calculator is successfully freed from memory. Otherwise false. Notes This function should deallocate all of the data from the calculator, then the calculator itself. Requirement Conditions Function double add calculator(int, int) double sub calculator(int, int) double mul_calculator(int, int) double div_calculator(int, int) double mod calculator(int, int) Input Parameters An integer a and b. Return Value A double value representing the output of a op b. Notes The functions should each use their associated operator in {+,-, *,/,%}. Structure Name Fields Functionality Calculator double (**operations) (int,int) Holds a list of function pointers to math operations. (typedef Calculator) int **data Holds the operational data from an input file. int operation Count Holds the total number of operations in the Calculator. int dataLength Holds the total number of data points from the input file. Your calculator program must include the following functions: Requirement Conditions Function Calculator* create_calculator (double (**)(int,int), int) Input Parameters An array of function pointers representing math operations and the length of that array. Return Value An initialized Calculator. Notes An initialized Calculator has no data. The operations and operation count should be saved. Requirement Conditions Function bool load calculator_data(Calculator*, char*) Input Parameters A pointer to a Calculator and a string representing a file name. Return Value Return true if data is successfully read and stored in the calculator. Otherwise false. Notes This function should read the data from the provided file and store it in the Calculator. Requirement Conditions Function void run calculator(Calculator*) Input Parameters A pointer to a Calculator. Return Value None. Notes This function should perform all of the operations in order and print them to stdout. Requirement Conditions Function bool destroy calculator(Calculator*) Input Parameters A pointer to a Calculator. Return Value Return true if the calculator is successfully freed from memory. Otherwise false. Notes This function should deallocate all of the data from the calculator, then the calculator itself. Requirement Conditions Function double add calculator(int, int) double sub calculator(int, int) double mul_calculator(int, int) double div_calculator(int, int) double mod calculator(int, int) Input Parameters An integer a and b. Return Value A double value representing the output of a op b. Notes The functions should each use their associated operator in {+,-, *,/,%}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!