Programming Problems and Solutions
This area of Vector64.com contains programming problems that you might
find in high-school or lower-level college courses. The problems will
will cover a variety of areas and assume that the student has completed
courses in Geometry and Algebra II. Problems that require math beyond
this level will generally provide details on that math.
Our approach will be to add problem pages over time.
This page is free to use for academic and personal use. If you use the
materials on this site, we only ask that you do not represent it as
your own work.
In general, supported platforms are Mac/OSX and GCC, Windows and GCC,
Windows and Microsoft Visual C++ and Linux and GCC. There should be
free command-line compilers for all of these platforms available on the
web. For Microsoft Visual C++, you can get the Visual C++ 2005 Express
Edition which is a free download until late in 2006. If they don't
extend the free offer, you can download the VS2003 Free Toolkit to use
as a compiler. The 2005 Express Edition provides a GUI development
environment while the Toolkit is command-line only.
We recommend using Vi, Emacs or XEmacs for editing your code but, of
course, the choice of an editor is up to you. Vi, Emacs and XEmacs can
generally be found on just about any desktop platform these days making
it easier for students to go from one platform to another.
- Hello, World A simple program to print a message to the screen.
- Unit Conversions A simple program to convert seconds to minutes, hours, days and years.
- For Loops Print numbers, forwards, backwards and with skipping.
- Remainder Find the remainder of an integer division using the modulus function.
Recommended Books for Reading and Reference
- The C Programming Language, Second Edition, by Brian W. Kernighan
and Dennis M. Ritchie, Prentice Hall Software Series. A favorite among
professionals and students alike going back a few decades. It is a
fairly thin book that can be used for learning the language or for
reference. It is probably not a good book to learn C if you don't have
prior programming experience with a procedural language.
- C++ How To Program, Fifth Edition, by Deitel and Deitel. This is
a very popular book for college programming courses. It is a fairly
large book and quite detailed and comes with many exercises and tips.
It is aimed at learning C++ so there are constructs there that are not
available in C but it is generally quite a good textbook. It is a
pretty good textbook if this is your first programming language and
Elliott (webmaster) thinks that it's the best programming book that
he's seen. He used this book in one of his programming classes.
- Applications Programming in ANSI C, Third Edition, by Richard
Johnsonbaugh and Martin Kalin. Elliott thinks that this book is
good but not great (he used the book in one of his classes). A look at
the reviews on Amazon.com indicate that it isn't a good book for
beginners but it does have a completeness for those willing to work
though the problems and read the book meticulously. I found that it
covers many computer science concepts probably making it good for a
class where the students are pretty diligent in reading the texts.
- Discrete Mathematics and Its Applications, Fifth Edition, by
Kenneth H. Rosen. This isn't a programming book but rather a book on
various kinds of mathematics useful in programming and computer
science. Many people say that courses using this book are considered
difficult but there are things in the book that can make doing
programming problems easier.
- Foundations of Computer Science C Edition, by Alfred V. Aho and
Jeffrey D. Ullman. This book integrates discrete mathematics with the
models, concepts and techniques of Computer Science. It can be
difficult reading for those just starting out in programming but it
does provide an introduction to program performance, stacks, queues,
linked lists, trees, etc.
- Computer Organization and Architecture, Second Edition, by
William Stallings. This was one of my course texts and Elliott has used
it in one of his courses as well. The book is mainly about hardware but
also covers instruction sets, integer and floating point
representation, some aspects of the operating system interaction with
hardware, CPUs and parallism. The current edition is the Fifth so our
text is pretty out of date but it still covers a lot of basic concepts
that haven't changed that much over time. The Fifth Edition is from
2002 which is a bit of a shame as this wouldn't cover the breathtaking
changes in CPUs resulting from fierce competition between Intel and AMD
in 2004 and 2005. One of the reasons that I like learning Computer
Science in C is that you are closer to the hardware than with a lot of
other languages which is why I have a hardware book in the reading list.
- Introduction to Algorithms, First Edition by Thomas H Cormen,
Charles E. Leiserson and Ronald L Rivest. A popular course text and
professional reference book. The material can be rather difficult for
beginners but there are many explanations of concepts and algorithms
that even the beginner may run into in a programming class.
- Elementary Linear Algebra, Seventh Edition, by Howard Anton.
Problems involving matrices are common as they require some exercise of
spatial skills. It is nice to have a reference book available that
covers matrix operations and algorithms to solve simultaneous linear
- Compilers: Principles, Techniques and Tools, by Alfred V. Aho,
Ravi Sethi and Jeffrey D. Ullman. Some programming students may be
curious as to how compilers work or why there are restrictions on
languages or what a process looks like at runtime or the phases that a
compiler goes through to compile a program. This book provides much
more detail than need to satisfy simple curiousity but it should be
enough to satisfy some basic curiousity.
- Operating System Concepts, Third Edition, by A. Silberschatz, J.
Peterson and P. Galvin. This edition is pretty old and I'm pretty sure
that there is a much more modern edition but this is the one that we
have in our library. This can be a book to just read through for
knowledge and enjoyment without the reader necessarily understanding
everything that's going on. The programmer can probably relate some
ideas in programming to constrants on operating systems.
Reading Review List
These are books that we have on order to be reviewed and used and will probably add to the list above.
- Data Structures and Algorithms by Alfred V. Aho, Jeffrey D.
Ullman and John E. Hopcroft. I've been looking for a Data Structures
book for a long time as I lost the one that I used in a class a long
time ago. I think that this book will provide a slower-paced approach
to data structures compared to Foundations of Computer Science.
- The Design and Analysis of Computer Algorithms by Alfred V. Aho,
Jeffrey D. Ullman and John E. Hopcroft. This again looks like a
slower-paced book compared to some of their other books.
- Mathworld at Wolfram
Research is Eric Weisstein's website that contains descriptions on a
huge number of topics in mathematics. You may find the site useful for
getting a quick description on some area of mathematics that you're
unfamiliar with. They also have a little area on their front page with
daily math news.
- Wikipedia C programming language entry provides a very nice backgrounder on the language and a few links to historical and programming websites.
Return to Homepage Return to Programming Pages
Updated November 29, 2005. For comments and questions, send email to Vector.x64 @ gmail.com (without the spaces).