User Tools

Site Tools


haas:fall2019:c4eng:projects:mtf1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:fall2019:c4eng:projects:mtf1 [2019/09/30 11:56] – [Submission] wedgehaas:fall2019:c4eng:projects:mtf1 [2019/10/01 12:07] (current) – [Specifications] wedge
Line 22: Line 22:
   * prompt the user for the operation ('+' for addition, '-' for subtraction, '*' for multiplication, '/' for division, and '%' for remainder)   * prompt the user for the operation ('+' for addition, '-' for subtraction, '*' for multiplication, '/' for division, and '%' for remainder)
     * properly store this in a variable of type **char**     * properly store this in a variable of type **char**
-    * check for a literal '+', '-', '*', or '/' symbol to determine operation to perform+    * check for a literal '+', '-', '*', '/', or '%' symbol to determine operation to perform
       * if invalid input, display an error and exit with a non-zero value of 1       * if invalid input, display an error and exit with a non-zero value of 1
   * prompt for the starting row (0-9)   * prompt for the starting row (0-9)
Line 46: Line 46:
   * For the math operations that are not associative, the row value is the one to be operated against (ie result=row-col).   * For the math operations that are not associative, the row value is the one to be operated against (ie result=row-col).
   * To display a '%' character using fprintf, repeat it: %%. That will cancel the otherwise substitutive properties of the symbol in the context of fprintf.   * To display a '%' character using fprintf, repeat it: %%. That will cancel the otherwise substitutive properties of the symbol in the context of fprintf.
 +=====Compiling=====
 +As we have been doing all along, use the following options to gcc when compiling:
 +
 +<cli>
 +lab46:~/src/c4eng/mtf1$ gcc -Wall --std=gnu99 -o mtf1 mtf1.c
 +lab46:~/src/c4eng/mtf1$ 
 +</cli>
 +
 =====Execution===== =====Execution=====
  
haas/fall2019/c4eng/projects/mtf1.1569844613.txt.gz · Last modified: 2019/09/30 11:56 by wedge