General Information | Announcements | Schedule | Labs | Homework | Quizzes/Tests | Lecture Notes

Loyola University Chicago

Computer Science 125-609
Introductory Programming
Michael Goldwasser

Fall 1999

Math. and Computer Science Dept.


ANNOUNCEMENTS

  • 30 Sep 1999 -- Let me stress that the extra credit for hw4 is for the very brave. Getting it to work will require using programming techniques that we have in no way covered. But, if you are still not scared off, and you want to see what an extra credit program would look like, feel free to download and run my extra credit executable

  • 30 Sep 1999 -- I made a minor change today to the 'mine' files available for homework 4. The reason was that the mines were not appearing on some systems because the font used to get the bomb picture was not properly loaded. For this reason, I also changed the background color of the squares with mines to be reddish, so that it is still clear which squares have mines. (If you are already successfully using the original code I provided, go right ahead).

  • 23 Sep 1999 -- Please note that tutoring is always available for this course (and others) on a walk-in basis or by apointment through either the department's Mathematics and Computer Science Learning Center or through the University's Learning Assistance Center.

  • 22 Sep 1999 -- An extension was given to everyone on lab4. It is due by the beginning of class time on 28 Sep 1999. (note: hw3 is also due at that time)

  • 15 Sep 1999 -- In lab3 and HW2 (and throughout the course), we will often need to pay closer attention to the numeric data types which Visual Basic uses (e.g. Integer, Long, Single, Double, Currency)

    Our textbook does not go into much detail about the types or the range of numbers which they can store, but it is important to know about or else we may often see "Overflow Error" as we try to do a calculation with a value which is too large/small to be represented by a particular data type.

    For example, if a variable or expression is using Integer data, you can only work with integers in the range -32,768 to 32,767. If you use a number out of this range, even during an intermediate calculation, you will get an error when running your program.

    The limits for some of the various numeric types are:

    Integer-32,768 to 32,767
    Long-2,147,483,648 to 2,147,483,647
    Single -3.402823E38 to -1.401298E-45 for negative values
    1.401298E-45 to 3.402823E38 for positive values.
    Double-1.79769313486232E308 to -4.94065645841247E-324 for negative values
    4.94065645841247E-324 to 1.79769313486232E308 for positive values
    Currency$-922,337,203,685,477.5808 to $922,337,203,685,477.5807
    So when writing your programs you may want to pick the numeric type based on the values you expect to deal with. Finally, you can always change the result of one type into a different type during runtime by using Visual Basic's conversion functions. For example typing CInt(< blah >) will force < blah > to be interpreted as an Integer. Similarly, CSng(), CDbl(), CLng(), CCur() force numbers to be converted to the respective data types.

  • 15 Sep 1999 -- Question 2 on quiz 2 was a bad question! I will accept either answer (A) or answer (C) as correct. Please bring your quiz to me if this applies.

    For those interested in an optional mini-lesson: The intent of the question was to test how visual basic deals with integers during division. Unfortunately, our textbook did not actually discuss this issue very clearly. Even more unfortunately, I wrote the problem wrong. The expression "7/4" gets evaluated using floating point division, and then at the very end when it is stored in Integer variable X, it is converted to an integer by way of rounding (and hence X=2 if you type in this code). To get a true integer division in visual basic you would type the expression "7\4" (note the slash used is in the other direction). This says to do division but only return the whole number of the result, and hence X=7\4 sets X to the value 1. For those really curious, if you want to get the remainder in such an integer division you can type "7 mod 4" for example, which would evaluate to 3 in this case, as 7 divide by 4 is equal to 1 with a remainder of 3.

  • 31 Aug 1999 -- If you have not already done so, please print, complete and turn in the following questionaire.

  • 31 Aug 1999 -- welcome to the class!

  • comp125-609 Class Page
    mhg@cs.luc.edu
    Last modified: 30 September 1999
    General Information | Announcements | Schedule | Labs | Homework | Quizzes/Tests | Lecture Notes