This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2014:cprog:projects:helloworld [2014/01/12 18:31] – [C program structure] wedge | haas:spring2014:cprog:projects:helloworld [2014/01/27 14:58] (current) – [Verify submission] wedge | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP centeralign round box> | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | ~~TOC~~ | ||
+ | |||
======Hello, | ======Hello, | ||
Line 162: | Line 169: | ||
And, for those really embracing these provided resources, feel free to create additional subdirectories to further organize your code. We'll be creating a lot of programs in here, and even this mild organization isn't enough to ward off a little searching later in the semester as the example programs pile up. | And, for those really embracing these provided resources, feel free to create additional subdirectories to further organize your code. We'll be creating a lot of programs in here, and even this mild organization isn't enough to ward off a little searching later in the semester as the example programs pile up. | ||
+ | |||
+ | =====Text Editor===== | ||
+ | Text editors can be a matter of great personal preference. | ||
+ | |||
+ | Ultimately, they are a fundamental program development tool, for they handle the various low-level file operations, enabling you to place desired content in specified files. | ||
+ | |||
+ | If you are entirely new to lab46 (and don't know any better), I would recommend the use of the **nano** text editor. It works in a manner consistent to other text entry programs you are likely accustomed. | ||
+ | |||
+ | To open **nano** on a new or existing file, merely specify the file name after the editor on the command-line. In this example, we will be creating a new file called **hello.c** in our current working directory: | ||
+ | |||
+ | <cli> | ||
+ | lab46: | ||
+ | </ | ||
+ | |||
+ | nano is a full screen editor, you'll notice a status bar on the top of the screen, and commands listed on the bottom few rows (< | ||
+ | |||
+ | If you have experience in UNIX on the command-line and know of/prefer other editors, feel free to use them. | ||
+ | |||
+ | For those also taking UNIX, you'll be learning the **vi** text editor, and I would encourage you to use it in as many settings as possible to aid you in your UNIX coursework (if you are not taking UNIX do not concern yourself with **vi**, it is a powerful editor that works according to a different philosophy). | ||
=====Hello, World====== | =====Hello, World====== | ||
For our purposes here, we will be writing our first program, which is also considered a classic. | For our purposes here, we will be writing our first program, which is also considered a classic. | ||
Line 225: | Line 251: | ||
* http:// | * http:// | ||
- | The nature of compilers themselves can warrant entire courses unto themselves. If you go on in Computer Science, at the 3rd/4th year or graduate level it is not uncommon to encounter " | + | The nature of compilers themselves can warrant entire courses unto themselves. If you go on in Computer Science, at the 3rd/4th year or graduate level it is not uncommon to encounter |
====Familiarize yourself with file states==== | ====Familiarize yourself with file states==== | ||
Line 278: | Line 304: | ||
Now we just have to learn all the various keywords and language rules, and familiarize ourselves with the necessary library functions to pull off even more spectacular solutions to problems. | Now we just have to learn all the various keywords and language rules, and familiarize ourselves with the necessary library functions to pull off even more spectacular solutions to problems. | ||
- | You may want to place your C source code (**hello.c**) in a repository for safe keeping- working with repositories is another helpful programming habit to have. | + | You will want to place your C source code (**hello.c**) in a repository for safe keeping- working with repositories is another helpful programming habit to have. |
+ | |||
+ | =====Submission===== | ||
+ | To successfully complete this project, the following criteria must be met: | ||
+ | |||
+ | * Code must compile cleanly (no warnings or errors) | ||
+ | * Executed program must display the intended message, exactly as presented, to STDOUT. | ||
+ | * Output must be correct (as per project specifications) | ||
+ | * 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 5% of your program consist of **< | ||
+ | * Output Formatting (including spacing) of program must conform to the provided output (see sample program output above). | ||
+ | * Track/ | ||
+ | * 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: | ||
+ | |||
+ | < | ||
+ | $ submit cprog helloworld hello.c | ||
+ | Submitting cprog project " | ||
+ | -> hello.c(OK) | ||
+ | |||
+ | SUCCESSFULLY SUBMITTED | ||
+ | </ | ||
+ | |||
+ | 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. | ||
+ |