User Tools

Site Tools


haas:spring2014:data:projects:nodes

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:spring2014:data:projects:nodes [2014/01/27 10:26] – [Linking our node to another node] wedgehaas:spring2014:data:projects:nodes [2014/01/27 10:58] (current) – [Submission] wedge
Line 11: Line 11:
 To review structs and pointers, and see how these two concepts, when combined, produces the core element of our class explorations. To review structs and pointers, and see how these two concepts, when combined, produces the core element of our class explorations.
  
 +=====Reference=====
 +You absolutely, positively, MUST watch this video: http://www.youtube.com/watch?v=5VnDaHBi8dM
 =====Structures===== =====Structures=====
 As we learned in C, there are two main composite data types available to us: As we learned in C, there are two main composite data types available to us:
Line 243: Line 245:
  
 {{ :haas:spring2014:data:projects:thirdnodeandtmp.jpg |}} {{ :haas:spring2014:data:projects:thirdnodeandtmp.jpg |}}
 +
 +=====Procedure=====
 +I would like for you to write a C program utilizing nodes to construct a simple list, joining new values onto the end of the last node.
 +
 +The program should do the following:
 +
 +  * implement a node containing signed char's (for **value**)
 +  * prompt the user to enter a value (-1 to exit)
 +  * allocate a node (or the next node-- you'll have to deal with first vs. remaining case logic)
 +  * obtain input from the user and assign it to the current node
 +  * once a -1 has been provided, display the list from beginning to end and then exit
 +
 +Sample output would look as follows:
 +
 +<cli>
 +lab46:~/src/data$ ./node
 +Enter a value (-1 to quit): 12
 +Enter a value (-1 to quit): 37
 +Enter a value (-1 to quit): 8
 +Enter a value (-1 to quit): 59
 +Enter a value (-1 to quit): 86
 +Enter a value (-1 to quit): 4
 +Enter a value (-1 to quit): -1
 +
 +List: 12 -> 37 ->  8 -> 59 -> 86 ->  4 -> NULL
 +lab46:~/src/data$ 
 +</cli>
 +
 +NOTE: This is just example input. Not only should your program work with this, but lists of any length, containing any arrangement of valid values.
 +
 +=====Submission=====
 +To successfully complete this project, the following criteria must be met:
 +
 +  * Handwritten diagram fully detailed for an 8 node list uploaded to your Opus
 +    * insert the image into your journal, and have related commentary on what is going on
 +    * submit the URL (to that week's journal entry) along with your program
 +  * Code must compile cleanly (no warnings or errors)
 +  * Executed program must display in a manner similar to provided output.
 +  * Output must be correct
 +  * Code must be nicely and consistently indented (you may use the **indent** tool)
 +  * Code must be commented
 +    * have a properly filled-out comment banner at the top
 +    * have at least 20% of your program consist of **<nowiki>//</nowiki>**-style descriptive comments
 +  * Track/version the source code in a repository
 +  * Submit a copy of your source code to me using the **submit** tool.
 +
 +To submit this program to me using the **submit** tool, run the following command at your lab46 prompt:
 +
 +<cli>
 +$ submit data nodes node.c http://lab46.corning-cc.edu/opus/SEMESTER/user/start#week_2
 +Submitting data project "nodes":
 +    -> node.c(OK)
 +    -> http://lab46.corning-cc.edu/opus/SEMESTER/user/start#week_2(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.
haas/spring2014/data/projects/nodes.1390818414.txt.gz · Last modified: 2014/01/27 10:26 by wedge