Exercise 05: Nested Loops

When you clone this assignment you will see four C files in which you are to write programs. Each file contains a comment with instructions. Write your code below the comment in each file.

Start with square.c, as it will be the easiest. Here are the four files sorted by increasing difficulty:

Submission

Make sure that your output matches the example output in the comments exactly or the tests will fail

NOTE: The outputs shown in the .out file might look odd. This is a result of the tests automating user input. This means that newlines will not appear after portions of code that prompt for keyboard intput. You can look at the precise command used to run the test by examining the .run test file associated with the test. You can copy and paste this command right into your terminal window to see how it works.

Local Testing

You can run tests for each of te programs using the following commands respectively:

make gh-test-square
make gh-test-triangle
make gh-test-pyramid
make gh-test-checkerboard

Submission

When you are confident your programs function correctly submit your work by saving your code and then using git to add the C files, commit, and pushing your changes. You can add all the files on one line if you want, like this:

git add square.c triangle.c pyramid.c checkerboard.c
git commit -m "This is an example commit message"
git push

You can also add them one at a time (with four individual git add commands).

Once you have pushed, check GitHub to see the results of testing your code. If any of your programs do not pass the tests, you may make changes and submit again. To submit again, simply add the file(s) that you changed, commit, and push again.

Grading

For full credit all the tests must pass

Your grade for this exercise will be out out of 10 points: