diff --git a/README.md b/README.md new file mode 100644 index 0000000..68b2d37 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# Simple Calculator + +This is a buggy application that will be used for Lab5 of 'Introduction to Open Source Software Development.' + + - Fork the project. + - Create a topic branch from master. + - The branch name must be your student id. (e.g. 201624000) + - Make some commits to improve the project. + - Fix the well-knwon bugs. + - Remove object and binary files. + - Add .gitignore file + - Push this branch to your GitHub project. + - Open a Pull Request on GitHub. + - The Pull Request must be submitted to master branch of Classroom-IOSSD/SimpleCalculator! + - Capture the Pull Request and upload it to PLMS. + diff --git a/calc b/calc new file mode 100755 index 0000000..516dfa9 Binary files /dev/null and b/calc differ diff --git a/calc.c b/calc.c index 85f1466..ee720a6 100644 --- a/calc.c +++ b/calc.c @@ -5,28 +5,39 @@ int main(){ FILE *fp = NULL; int operand1, operand2; char operator = ' '; - int result, line = 0; - + int line = 0; + double result; + double (*funcp)(int, int); + double (*funcp2)(double, double); fp = fopen("read.txt","r"); if(fp!=NULL){ fscanf(fp, "%d", &line); - for(int i=0; i