Hi there i'm working on an assignment and i have hit a problem.
Here is the question:

Write a program to model a simple calculator. Each data line should consist of the next operation to be preformed from the list below and the right operand. Assume the left operand is the accumulator value (initial value of 0). You need a function scan_data with two output parameters that returns the operator and right operand scanned from the data line. You need a function do_next_op that performs the required operation. do_next_op has two input parameters (the operator and operand) and one input/output parameter (the accumulator). The valid operators are:

+ add
- subtract
* multiply
/ divide
^ power (raise left operand to the power of the right operand)
q quit

Your calculator should display the accumulator value after each operation. A sample run follows.
+ 5.0
Result so far is 5.0
^ 2
Result so far is 25.0
/ 2.0
Result so far is 12.5
q 0
final result is 12.5


So far this is what i have down for this
insert
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>


void help(void);
void scan_data(char sign, float num);
void do_next_op(char sign, float num);

int main() 
{
    int x, y, sum;
	char op, temp;
	
	scan_data('p',9);
	
	return 0;
}

void help(void)
{
 char op[3] ;
 char text[9];
		FILE *help;

help = fopen("operator.txt","w");
fprintf(help,"%s\t%s\n", "+" , "add");
fprintf(help,"%s\t%s\n", "-" , "subtract");
fprintf(help,"%s\t%s\n", "*" , "multiply");
fprintf(help,"%s\t%s\n", "/" , "divide");
fprintf(help,"%s\t%s\n", "^" , "power");
fprintf(help,"%s\t%s", "q" , "quit");

fclose(help);

help = fopen("operator.txt", "r");

while(!feof(help))
{
	fscanf(help, "%s\t%s", &op, &text);
printf("%s\t%s\n", op, text);
}

fclose(help);
}

void scan_data(char sign, float num)
{
	
    char op, temp;
	float num1;
		
			scanf("%c", &temp);
			printf("Enter an operator [^,*,/,+,-, q(quit), h(help)]:\n");
			scanf("%c", &op);
			
		
			
			if(op=='q'||op=='Q')
			{
				exit(0);
			}
			if(op=='h'||op=='H')
			{
				help();
				
			}

				printf("Enter a number to calculate for: ");
				scanf("%f", &num1);
				printf("%c%1.2f\n",op ,num1);
				
				do_next_op(op, num1);
	
	

}

void do_next_op(char sign, float num)
{
	float sum = 0;
	
	
	switch(sign)
	{
	case('^'):
	{
		sum=pow(sum,num);
		printf("The result so far is %1.2f\n", sum);
		scan_data('p',9);
	}
	
	case('*'):
		{
		sum=sum*num;
		printf("The result so far is %1.2f\n", sum);
		scan_data('p',9);
		
		}
	case('/'):
		{
		if(sign=='/')
		{
		 if(num<=0)
		{
			 printf("Can not divide by 0\n");
			 scan_data('p',9);
			}
			if(num>0)
			{
			
			sum=sum/num;
			printf("The result so far is %1.2f\n", sum);
			scan_data('p',9);
			}
			
		}
		
		
		}
	case('+'):
		{
			sum=sum+num;
			printf("The result so far is %1.2f\n", sum);
			scan_data('p',9);
				
		}
	case('-'):
	{
		sum=sum-num;
		printf("The result so far is %1.2f\n", sum);
		scan_data('p',9);
		
	}
	default:
		break;
	

	}
}
Sorry if its a bit messy or confusing in certain places, I like to fix these things up after my test runs work.