Introduction

This lab will give you some experience configuring and using IDEs. The starter code is available in your Lab06 git repository on GitLab.

Problem 0: Clean up after yourself

You’ll notice that this repository doesn’t have a .gitignore file. During this assignment, you should periodically run git status to see what kinds of files geany and codeblocks have dropped in your repository.

Remember that we don’t want to commit:

  • Compiled files
  • Editor backup files
  • Other crumbs (like .DS_Store)
  • Anything that’s not listed in the epilogue section.

You need to create a .gitignore to help keep things clean.

We will ding you for leaving junk in your repository when we grade. If you have any questions about which files to ignore, just ask!

Problem 1: Geany

  1. Create a project for the assignment.
    • Name your project file triangle.geany.
  2. Import the existing files into the project.
  3. Build and run the code. (Remember, you need to tweak the build settings to work correctly.)
  4. Implement the combination function in funcs.cpp. The combination operator, most commonly known as part of the Binomial Theorem but also widely useful in statistics and combinatorics, is defined by the following operation:

    \begin{equation} {n \choose m} = \frac{n!}{m!(n-m)!} \end{equation}

    The combination operator is also used to generate Pascal’s Triangle, which is what we will be doing in this assignment.

  5. It’d probably be good to write a bit of code in main to test and make sure your function works.
  6. git add your Geany project file and your changes to funcs.cpp and main.cpp.

  7. git commit your changes.

Problem 2: Code::Blocks

  1. Create a project for the assignment.
  2. Import the existing files into the project.
  3. Build and run the code. (Don’t forget to turn on -Wall!)
  4. Use the TrianglePrinter class to print out the first 7 rows of Pascal’s Triangle. add() will add a number to the current row and newrow() will start a new row.

    The first row of Pascal’s triangle is …

    \begin{equation} {0 \choose 0} \end{equation}

    The second row is …

    \begin{equation} {1 \choose 0}, {1 \choose 1} \end{equation}

    … and so on and so forth.

  5. Try using the Code::Blocks debugger to step through your program.

  6. git add your Code::Blocks project file and your changes to main.cpp.

  7. git commit your changes.

Problem 3: Well…?

Create a file called impressions.md. In this file, write a couple of paragraphs about your impressions of geany and Code::Blocks.

Why the .md extension?

You’re going to write your responses using Markdown. Markdown is a plain text format that is easy to read and can be easily converted to HTML, PDFs, Word documents, etc. This whole website is written in Markdown. That includes the slideshows!

Use this Markdown Reference to get an idea of how to bold, italicize, make lists, etc.

Here’s a template to get you started

<!-- This what a comment looks like. It is super ugly. -->

<!-- We can create a section header by underlining the words with = -->

Geany
=====

<!-- Your columns should not be longer than 80 columns. -->

Here is a very short paragraph. It has two sentences, which my high
school English teacher says is enough.

Code::Blocks
============

Here is another short paragraph. It also has two sentences, but now
I'm less sure that my high school English teacher knew what he was
talking about.

Here are some things to consider discussing in your impressions.md:

  • What did you like about each IDE?
  • What didn’t you like about each IDE?
  • What features do you wish you had in each IDE?

Epilogue

As always, your git repo on http://git-classes.mst.edu is your submission. Don’t forget to commit and push all relevant files. Make sure you see everything you expect on GitLab!

We expect to see the following files on your master branch:

  • .gitignore
  • funcs.cpp
  • funcs.h
  • impressions.md
  • main.cpp
  • README.md
  • triangle.geany (your geany project file)
  • triangle.cbp (your Code::Blocks project file)
  • TrianglePrinter.cpp
  • TrianglePrinter.h

Notice that there are no directories in there! Don’t let geany or Code::Blocks create a project subdirectory. All of the files should be at the root of your repository.

Tips / Hints / Things

  • Make sure you start Xming before you try to forward any X11 windows.

  • If geany complains that it’s unable to open its shell…
    • Go to Edit > Preferences > Tools
    • Change Terminal from x-terminal-emulator -e "/bin/sh %c" to xterm -e "/bin/sh %c"
  • Don’t1 start Code::Blocks if your pwd is in your SDRIVE. Try changing to your linuxhome directory (i.e., cd ~). Otherwise you’ll be waiting all day for Code::Blocks to open up.

  • Code::Blocks doesn’t like SDRIVEs. You can either:
    • Clone your repo to your linuxhome (e.g., ~/lab06)
    • Tell Code::Blocks the absolute path to your project in your SDRIVE (e.g., /nethome/users/<username>/cs1001/lab06/ or whatever you call it.)
  1. Meaning “do not”