User Tools

Site Tools


haas:fall2022:cprog:projects:sam0

Differences

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

Link to this comparison view

Next revision
Previous revision
haas:fall2022:cprog:projects:sam0 [2021/09/12 13:32] – created - external edit 127.0.0.1haas:fall2022:cprog:projects:sam0 [2022/10/16 15:12] (current) – [Submission] wedge
Line 60: Line 60:
 Your program should be a "one shot". It should only perform its intended operation and exit. No prompting for encode/decode, no "do you want to go again"... just a read from input, process, output, and exit with appropriate return value. They should conform to the execution examples found in this project. Your program should be a "one shot". It should only perform its intended operation and exit. No prompting for encode/decode, no "do you want to go again"... just a read from input, process, output, and exit with appropriate return value. They should conform to the execution examples found in this project.
  
-When compiling, an additional constraint is added: compile with the **-Wall** and **<nowiki>--</nowiki>std=gnu99** flags.+When compiling, an additional constraint is added: compile with the **-Wall** and **<nowiki>--</nowiki>std=gnu18** flags.
 ====Sample execution: encode==== ====Sample execution: encode====
 Via positive command-line key: Via positive command-line key:
Line 142: Line 142:
 lab46:~/src/SEMESTER/DESIG/sam0$  lab46:~/src/SEMESTER/DESIG/sam0$ 
 </cli> </cli>
 +
 +=====Pseudocode=====
 +
 +====encode====
 +Your encode may end up flowing something like the following:
 +
 +<code>
 +MODULE ENCODE (RECEIVES MESSAGE AND KEY):
 +    LOOP THROUGH EACH CHARACTER IN THE MESSAGE:
 +        CHARACTER IS SET TO NUMERIC VALUE OF CHARACTER PLUS THE KEY
 +        SHOULD THE CHARACTER EXCEED THE RANGE OF DISPLAYABLE CHARACTERS:
 +            RESET CHARACTER TO START OF RANGE PLUS REMAINING OFFSET OF KEY
 +        SHOULD THE CHARACTER GO BELOW THE RANGE OF DISPLAYABLE CHARACTERS:
 +            RESET CHARACTER TO END OF RANGE MINUS REMAINING OFFSET OF KEY
 +
 +        SET MODIFIED CHARACTER TO RESULT MESSAGE
 +    END LOOP
 +    SEND BACK RESULT MESSAGE
 +END MODULE
 +</code>
 +
 +====decode====
 +<code>
 +MODULE DECODE (RECEIVES MESSAGE AND KEY):
 +    LOOP THROUGH EACH CHARACTER IN THE MESSAGE:
 +        CHARACTER IS SET TO NUMERIC VALUE OF CHARACTER MINUS THE KEY
 +        SHOULD THE CHARACTER EXCEED THE RANGE OF DISPLAYABLE CHARACTERS:
 +            RESET CHARACTER TO START OF RANGE PLUS REMAINING OFFSET OF KEY
 +        SHOULD THE CHARACTER GO BELOW THE RANGE OF DISPLAYABLE CHARACTERS:
 +            RESET CHARACTER TO END OF RANGE MINUS REMAINING OFFSET OF KEY
 +
 +        SET MODIFIED CHARACTER TO RESULT MESSAGE
 +    END LOOP
 +    SEND BACK RESULT MESSAGE
 +END MODULE
 +</code>
  
 =====Submission===== =====Submission=====
Line 147: Line 183:
  
   * Code must compile cleanly (no warnings or errors)   * Code must compile cleanly (no warnings or errors)
-    * Use the **-Wall** and **<nowiki>--std=gnu99</nowiki>** flags when compiling.+    * Use the **-Wall** and **<nowiki>--std=gnu18</nowiki>** flags when compiling.
   * Output must be correct, and resemble the form given in the sample output above.   * Output must be correct, and resemble the form given in the sample output above.
   * Code must be nicely and consistently indented (you may use the **indent** tool)   * Code must be nicely and consistently indented (you may use the **indent** tool)
haas/fall2022/cprog/projects/sam0.1631453525.txt.gz · Last modified: 2021/09/12 13:32 by 127.0.0.1