User Tools

Site Tools


Sidebar

projects

pct0 (bonus; due 20190821)
cci0 (due 20190821)
wcp1 (due 20190821)
dtr0 (bonus; due 20190828)
pct1 (due 20190828)
wcp2 (due 20190828)
pct2 (due 20190904)
wcp3 (due 20190904)
sof0 (due 20190911)
pct3 (due 20190911)
wcp4 (due 20190911)
dow0 (due 20190918)
pct4 (due 20190918)
wcp5 (due 20190918)
mtf0 (due 20190925)
pct5 (due 20190925)
wcp6 (due 20190925)
mtf1 (due 20191002)
pct6 (due 20191002)
wcp7 (due 20191002)
bcf0 (due 20191010)
epf1 (due 20191010)
pct7 (due 20191009)
wcp8 (due 20191009)
cnv0 (due 20191023)
pct8 (bonus; due 20191023)
pct9 (due 20191023)
wcp9 (due 20191023)
cnv1 (due 20191030)
pctA (due 20191030)
wcpA (due 20191030)
fwf0 (due 20191106)
pctB (due 20191106)
wcpB (due 20191106)
cos0 (due 20191113)
pctC (due 20191113)
wcpC (due 20191113)
eoce (due 20191211 by 172959)
haas:fall2019:c4eng:projects:fwf0

This is an old revision of the document!


Corning Community College

ENGR1050 C for Engineers

Project: VISUALIZATION - FUN WITH FLAGS (fwf0)

Objective

To create a program that generates a number of images corresponding to various flags of varying levels of design complexity.

Reading

In “The C Book”, please read through Chapter 7.

Background

In class we explored the visualization capabilities made available to us with the GD library.

For this project, you will be using that library to render images of various flags.

While you are not restricted to officially recognized country flags, they do offer a great starting point:

If there is some fictional country, other state/county/canton, or organization symbol you would like to implement instead, you are welcome to (so long as they conform to the difficulty levels specified below).

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 “intermediate” flag, and one “medium” flag.

Difficulties are defined as follows:

Easy

An easy-level flag has the following criteria:

  • Solid colours, often in bands
  • Examples: France, Mali, Belgium

Intermediate

Intermediate-level flags are classified as follows:

  • At least three distinct colours used on the flag.
  • More than one geometric shape utilized on the flag (ie not JUST rectangles/squares).
  • Examples: Maldives, Burkina Faso, Burundi

Medium

  • Three or more colours
  • Contains three different geometric shapes (oval(s), triangle(s), star(s), rectangle(s))
  • Examples: Malaysia, Algeria, Antigua and Barbuda

Complex

  • Increased level of detail above that of medium
  • Creation utilizes loops
  • Examples: USA, Croatia, Philippines

Program

It is your task to write a program (or programs) that generate a total of two different flag images, hosted under your lab46 webspace under a fwf0 directory, named and accessible as follows:

  • fwf0/flag1.png
  • fwf0/flag2.png

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

Your program should:

  • have valid, descriptive variable names of length no shorter than 4 symbols
  • have consistent, well-defined indentation (no less than 4 spaces per level of indentation)
    • 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
  • perform the intended operation, outputting the correct/accurate information in indicated format
  • using a single return statement at the conclusion of the code, return a 0 indicating successful operation

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.

Execution

Secondary number output

lab46:~/src/c4eng/cnv1$ ./cnv1
Enter a lower bound: 3
Enter an upper bound: 12
4 6 8 9 10
lab46:~/src/c4eng/cnv1$ 

The execution of the program is short and simple- obtain the input, do the processing, produce the output, and then terminate.

Compiling

As we have been doing all along, use the following options to gcc when compiling:

lab46:~/src/c4eng/cnv1$ gcc -Wall --std=gnu99 -o cnv1 cnv1.c
lab46:~/src/c4eng/cnv1$ 

Reference

In the C4ENG public directory, inside the cnv1 subdirectory, will be a copy of my implementation (in executable form, by the name ref_cnv1), which abides by the project specifications. Please compare its output against that of your implementation.

lab46:~/src/c4eng/cnv1$ /var/public/fall2019/c4eng/cnv1/ref_cnv1
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:~/src/c4eng/cnv1$ 

Verification

In addition, I have also placed a cnv1verify script in that same subdirectory, which will test your program against a range of values, to determine overall correctness.

lab46:~/src/c4eng/cnv1$ /var/public/fall2019/c4eng/cnv1/cnv1verify
[  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:~/src/c4eng/cnv1$ 

Submission

To successfully complete this project, the following criteria must be met:

  • Code must compile cleanly (no notes, warnings, nor errors)
  • Output must be correct, and match the form given in the sample output above.
  • Code must be nicely and consistently indented
  • Code must be well commented
  • Do NOT double space your code. Group like statements together.
  • Output Formatting (including spacing) of program must conform to the provided output (see above).
  • 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:

$ submit c4eng cnv1 cnv1.c
Submitting c4eng project "cnv1":
    -> cnv1.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.

What I'll be looking for:

78:cnv1:final tally of results (78/78)
*:cnv1:proper error checking and status reporting performed [13/13]
*:cnv1:correct variable types and name lengths used [13/13]
*:cnv1:proper output formatting per specifications [13/13]
*:cnv1:runtime tests of submitted program succeed [13/13]
*:cnv1:no negative compiler messages for program [13/13]
*:cnv1:code is pushed to lab46 repository [13/13]

Additionally:

  • Solutions not abiding by spirit of project will be subject to a 25% overall deduction
  • Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction
  • Solutions not utilizing indentation to promote scope and clarity will be subject to a 25% overall deduction
  • Solutions not organized and easy to read are subject to a 25% overall deduction
haas/fall2019/c4eng/projects/fwf0.1572265451.txt.gz · Last modified: 2019/10/28 12:24 by wedge