Monday, October 10, 2011

Lab 1 - miles per gallon algorithm

You are to complete exercise 20, p 27.

You need to type up the algorithm you would use to solve the problem presented.

Submit your algorithm as a text attachment to an email to me.

Due Date:
Thursday, October 13th, 8:00am

Grades

Final grades for this class will be determined according to the following criteria:
  • Test average
  • Lab assignments
  • Homework

Homework 2 - random number

You are to write a console application that generates a random number (from 1 - 10) for the user. Display a short menu to the user, informing them which input will generate a random number and which input will terminate the program. Your solution must include a do-while loop and a switch statement.

Sunday, October 9, 2011

Reading assignment - chapter 5

Read chapter 5, Control Structures II (Repetition).

Due Date
Monday, October 10th, 6:00pm

Code submission

I am using Bloodshed's Dev-C++ IDE to test your code. When you submit your homework and your labs from now on, you will need to send me your whole project, not just your .cpp file(s).

Wednesday, October 5, 2011

Just say no to "magic numbers"

It is unacceptable to use "magic numbers" in your source code. When dealing with trivial programs, using a naked number doesn't look like such a big deal (the code is short and, if well commented, the intent of the programmer is clear) but it is still a very bad habit to develop. The problem is both clearer to see and greatly magnified once the size of the code in question is larger.

Monday, October 3, 2011

Homework 1 - days in month

You are to write a program that reads in the month and year and displays for the user the number of days in that month. You must use assert to error trap the input and you must be able to determine if the year entered is a leap year.