User Tools

Site Tools


haas:fall2019:discrete:projects:nbm0

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:discrete:projects:nbm0 [2019/09/09 13:20] – [Submission Criteria] wedgehaas:fall2019:discrete:projects:nbm0 [2019/09/09 13:23] (current) – [base conversion] wedge
Line 9: Line 9:
 To apply your skills in crafting and deploying an algorithm that will enable you to convert a value from a source base to a destination base. To apply your skills in crafting and deploying an algorithm that will enable you to convert a value from a source base to a destination base.
  
-=====base conversion=====+=====number bases=====
  
 Number representation, as we first learned it, revealed a beautiful system of places with various weight values. Each place can increment or decrement its available counting digits until we reach either end of our range, then we "roll over". In the case of addition, our highest counting digit rolls over to our lowest one, and we carry a one over to the next highest weighted place value. Number representation, as we first learned it, revealed a beautiful system of places with various weight values. Each place can increment or decrement its available counting digits until we reach either end of our range, then we "roll over". In the case of addition, our highest counting digit rolls over to our lowest one, and we carry a one over to the next highest weighted place value.
Line 33: Line 33:
     * argv[3]: output base (represented from the point of view of base 10)     * argv[3]: output base (represented from the point of view of base 10)
       * base can be any from range of 2-36 (inclusive)       * base can be any from range of 2-36 (inclusive)
-  * on invalid base (< 2 or > 36, display an error to STDERR and exit).+  * on invalid base (< 2 or > 36, display an error to STDERR and exit with non-zero value).
   * converts those values into processable numeric values   * converts those values into processable numeric values
     * if input value contains invalid counting digits for base, display an error to STDERR and exit.     * if input value contains invalid counting digits for base, display an error to STDERR and exit.
Line 39: Line 39:
   * displays the output value to STDOUT, followed by a single newline.   * displays the output value to STDOUT, followed by a single newline.
     * Make sure your program ONLY displays the converted value to STDOUT- we will use this for output validation purposes.     * Make sure your program ONLY displays the converted value to STDOUT- we will use this for output validation purposes.
-  * program then exits.+  * program then exits, returning 0 on successful execution.
  
 +====Restrictions====
 Additional constraints: Additional constraints:
  
Line 50: Line 51:
     * you may assume a MAXIMUM quantity of 2^64 (basically what can be stored in an **unsigned long long int**), aka 8 bytes for packed data, up to 64 bytes for per-digit binary values.     * you may assume a MAXIMUM quantity of 2^64 (basically what can be stored in an **unsigned long long int**), aka 8 bytes for packed data, up to 64 bytes for per-digit binary values.
  
 +=====Sample Output=====
 Sample output is as follows: Sample output is as follows:
  
Line 76: Line 78:
 </cli> </cli>
 =====Submission===== =====Submission=====
-====Project Submission==== 
-To submit this program to me using the **submit** tool, run the following command at your lab46 prompt: 
- 
-<cli> 
-lab46:~/src/discrete/nbm0$ submit discrete nbm0 nbm0.c 
-Submitting discrete project "nbm0": 
-    -> nbm0.c(OK)  
- 
-SUCCESSFULLY SUBMITTED 
-</cli> 
- 
-You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches. 
  
 =====Submission===== =====Submission=====
haas/fall2019/discrete/projects/nbm0.1568035221.txt.gz · Last modified: 2019/09/09 13:20 by wedge