# QuadGen

I occasionally visit the dark side. This program was written using the Windows XP operating (?) system. My excuse is that I had to demo it on a Windows machine. (I haven't tried yet but it should recompile on Linux or OS X.)

This endeavour definitely qualifies as geeky. It's a C program that uses random numbers to generate a worksheet problem set for factoring quadratic (trinomial) expressions. It uses Donald Knuth's wonderful contribution, Latex, to mathematically typeset the worksheets. (You must have Latex installed on your system; I used Miktex for Windows for this.) Then the program creates pdf versions of the worksheet and a solution sheet.

Here is an example of a worksheet and its solution.

Here is the C code. It's the first program I've written in over a year so it's probably not the tightest or most elegant. But I had fun writing it, which is the most important part. It's all in one file for easy downloading.

To get the Windows executable, right-click on quadgen.exe. To run the program, just double click on quadgen.exe. You will be asked a number of questions:

• How many questions with both factors positive?
• How many questions with both factors negative?
• How many questions with a factor of each sign?
• How many difference of squares questions?
• Press Y to confirm, N to re-enter (or Q to quit)

Then, just like magic, you'll have two pdf files. The pdf files have weird names; this is to make them unique so that if you run the program repeatedly, you won't overwrite previous pdf files.

For example, QuadFactT_338_11_13_26.pdf is a worksheet, written on the 338th day of the year, at 11:13 (and a few parts of a second) in the morning. QuadFactS_338_11_13_26.pdf is the corresponding solution sheet.

There are a few things I need to fix. I need to make a place for students to write their name. I probably should go back to just using one column; this will leave room for students' work on the right hand side of the page.

And there are a few things I need to add.

• Like the option to expand quadratics: starting with (x+a)(x+b) and requesting the expanded quadratic.
• Like finding the roots of a quadratic equation: x=a or x=b
• Like finding the roots of a quadratic equation using the formula

All in good time, I guess.