This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
haas:fall2019:c4eng:projects:fwf0 [2019/10/28 12:09] – created wedge | haas:fall2019:c4eng:projects:fwf0 [2019/10/28 13:09] (current) – [Grabbing project resources] wedge | ||
---|---|---|---|
Line 23: | Line 23: | ||
If there is some fictional country, other state/ | If there is some fictional country, other state/ | ||
- | You are tasked with creating two different flags (this can be in the same program, or in the form of two separate programs, your choice), of differing levels of complexity. Namely, one " | + | You are tasked with creating two different flags (from one program), of differing levels of complexity. Namely, one " |
Difficulties are defined as follows: | Difficulties are defined as follows: | ||
Line 38: | Line 38: | ||
* At least three distinct colours used on the flag. | * At least three distinct colours used on the flag. | ||
* More than one geometric shape utilized on the flag (ie not JUST rectangles/ | * More than one geometric shape utilized on the flag (ie not JUST rectangles/ | ||
- | * Examples: | + | * Examples: |
+ | ====Medium==== | ||
+ | * Three or more colours | ||
+ | * Contains three different geometric shapes (oval(s), triangle(s), | ||
+ | * Examples: Malaysia, Algeria, Antigua and Barbuda | ||
+ | ====Complex==== | ||
+ | * Increased level of detail above that of medium | ||
+ | * Creation utilizes loops | ||
+ | * Examples: USA, Croatia, Philippines | ||
=====Program===== | =====Program===== | ||
- | It is your task to write a program that, upon accepting various pieces | + | It is your task to write a program that generate a total of two different flag images, hosted under your lab46 webspace under a **fwf0/** directory, named and accessible as follows: |
+ | |||
+ | * fwf0/ | ||
+ | * fwf0/ | ||
+ | |||
+ | flag1 is to be in intermediate (or greater) level flag, and flag2 is to be a medium (or greater) level flag. | ||
+ | |||
+ | Opting to do higher difficulties may earn you some bonus points. | ||
=====Specifications===== | =====Specifications===== | ||
Line 52: | Line 67: | ||
* all code within the same scope aligned to its indentation level | * all code within the same scope aligned to its indentation level | ||
* have proximal comments explaining your rationale and what is going on, throughout your code | * have proximal comments explaining your rationale and what is going on, throughout your code | ||
- | * to STDERR, prompt for the number (range appropriate of an unsigned long int) | + | * perform |
- | * properly store this in a variable of type **unsigned long int** | + | * at the end of your main() function, use a single return statement |
- | * immediately after the input, check to make sure the input number is a positive number greater than or equal to 2; if in violation, display an error (to STDERR) and exit with a non-zero value. | + | |
- | * proceed to evaluate | + | |
- | * if it is, display the value to STDOUT in space-separated form (see execution section below for message) | + | |
- | * if it is not, do not display anything related to that value (again, see execution section below) | + | |
- | * using a single return statement | + | |
Some additional points of consideration: | Some additional points of consideration: | ||
* Note that the driving variables in your loops need to be at least of type **short int**, otherwise you may get a warning when you compile it. | * Note that the driving variables in your loops need to be at least of type **short int**, otherwise you may get a warning when you compile it. | ||
- | =====Execution===== | + | =====Grabbing project resources===== |
+ | I have prepared a **grabit** for resources related to this project. To obtain: | ||
- | ====Secondary number output==== | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | Enter a lower bound: 3 | + | make: Entering directory '/ |
- | Enter an upper bound: 12 | + | '/ |
- | 4 6 8 9 10 | + | '/ |
- | lab46: | + | make: Leaving directory '/ |
+ | lab46: | ||
</ | </ | ||
- | The execution of the program is short and simple- obtain the input, do the processing, produce the output, and then terminate. | + | At which point you can change into the newly created |
=====Compiling===== | =====Compiling===== | ||
- | As we have been doing all along, use the following options to gcc when compiling: | + | Since the grabit brought in a Makefile, you can compile your code simply by typing: **make** |
- | < | + | Any compiler errors will go into a text file called **errors** |
- | lab46: | + | |
- | lab46: | + | |
- | </ | + | |
- | =====Reference===== | + | To do a full cleaning, run: **make clean** then **make** (or **make debug**) |
- | In the C4ENG public directory, inside the **cnv1** subdirectory, | + | |
- | < | + | If you'd like to see compiler messages as you compile, run: **make debug** |
- | lab46:~/ | + | |
- | Enter a lower bound: 2 | + | |
- | Enter an upper bound: 40 | + | |
- | 4 6 8 9 10 14 15 21 22 25 26 27 33 34 35 38 39 | + | |
- | lab46: | + | |
- | </ | + | |
- | =====Verification===== | + | When done and ready to submit, on lab46: |
- | In addition, I have also placed a **cnv1verify** script in that same subdirectory, | + | |
- | <cli> | ||
- | lab46: | ||
- | [ 1] you have: err, should be: err [ 2] you have: no, should be: no | ||
- | [ 3] you have: no, should be: no [ 4] you have: yes, should be: yes | ||
- | [ 5] you have: no, should be: no [ 6] you have: yes, should be: yes | ||
- | [ 7] you have: no, should be: no [ 8] you have: yes, should be: yes | ||
- | [ 9] you have: yes, should be: yes [ 10] you have: yes, should be: yes | ||
- | [ 11] you have: no, should be: no [ 12] you have: no, should be: no | ||
- | [ 13] you have: no, should be: no [ 14] you have: yes, should be: yes | ||
- | [ 15] you have: yes, should be: yes [ 16] you have: no, should be: no | ||
- | [ 17] you have: no, should be: no [ 18] you have: no, should be: no | ||
- | [ 19] you have: no, should be: no [ 20] you have: no, should be: no | ||
- | [ 21] you have: yes, should be: yes [ 22] you have: yes, should be: yes | ||
- | [ 23] you have: no, should be: no [ 24] you have: no, should be: no | ||
- | [ 25] you have: yes, should be: yes [ 26] you have: yes, should be: yes | ||
- | [ 27] you have: yes, should be: yes [ 28] you have: no, should be: no | ||
- | [ 29] you have: no, should be: no [ 30] you have: no, should be: no | ||
- | [ 31] you have: no, should be: no [ 32] you have: no, should be: no | ||
- | [ 33] you have: yes, should be: yes [ 34] you have: yes, should be: yes | ||
- | [ 35] you have: yes, should be: yes [ 36] you have: no, should be: no | ||
- | lab46: | ||
- | </ | ||
=====Submission===== | =====Submission===== | ||
To successfully complete this project, the following criteria must be met: | To successfully complete this project, the following criteria must be met: | ||
Line 135: | Line 112: | ||
<cli> | <cli> | ||
- | $ submit c4eng cnv1 cnv1.c | + | $ submit c4eng fwf0 fwf0.c |
- | Submitting c4eng project "cnv1": | + | Submitting c4eng project "fwf0": |
- | -> cnv1.c(OK) | + | -> fwf0.c(OK) |
SUCCESSFULLY SUBMITTED | SUCCESSFULLY SUBMITTED | ||
Line 147: | Line 124: | ||
< | < | ||
- | 78:cnv1:final tally of results (78/78) | + | 78:fwf0:final tally of results (78/78) |
- | *:cnv1:proper error checking and status reporting performed [13/13] | + | *:fwf0:proper error checking and status reporting performed [13/13] |
- | *:cnv1:correct variable types and name lengths used [13/13] | + | *:fwf0:correct variable types and name lengths used [13/13] |
- | *:cnv1:proper output formatting per specifications [13/13] | + | *:fwf0:proper output formatting per specifications, flag 1 [13/13] |
- | *:cnv1:runtime tests of submitted program succeed | + | *:fwf0:proper output formatting per specifications, |
- | *:cnv1:no negative compiler messages for program [13/13] | + | *:fwf0:no negative compiler messages for program [13/13] |
- | *:cnv1:code is pushed to lab46 repository [13/13] | + | *:fwf0:code is pushed to lab46 repository [13/13] |
</ | </ | ||