Introduction and Chapter 1

January 8-10 January 13-17 January 20-24 January 27-31 February 3-7 February 10-14 February 24-28 March 3-7 March 10-14 March 17-21 March 24-28 March 31-April 4 April 7-11
Introduction:

Welcome to CS110

You will find the course syllabus, assignments and general information about the class inside UR Courses. The applied lab material in the course is developed and maintained by the lab instructors at http://www.cs.uregina.ca/Links/class-info/110/. You will need to read the textbook to learn the course material, but the text is just the starting point. The labs are going to be a key component in your learning this semester. I will be using this UR Courses site to provide examples and reference material to help in your learning. I will also post assignments. Please try to regard the assignments as part of the learning process. Yes, grades will be attached to doing the assignment work and you need to write lots of code in order to become proficient. But, I plan to use the student teaching assistants to help you understand this whole business of solving problems by expressing the solution as program code.

Note that the term "lab seminar" as used below refers to your weekly lab time. Attendance is required.

During your first lab seminar, your lab instructor will verify that you have the userid that serves as both your University of Regina e-mail account identification and your UR Courses account id. You will hear about getting yourself a compiler to use during the semester. You can always work in the lab but "getting a compiler" means setting yourself up to work on your personal laptop or home computer. We use Microsoft's Visual Studio 2010 in the lab. You can get this software (or a more recent version) for free. Mac users may want to obtain Apple's Xcode, also free, from the Apple App Store. You will also be able to compile programs on a machine called Hercules. We'll distribute accounts for Hercules in the lab.

CS110 is probably not your first experience with UR Courses and you may be quite familiar with the process. Your University of Regina userid is the account provided to all U of R students by the Information Services Department. You will use this account for e-mail during CS110. But note that this account is yours as long as you are taking U of R classes. Again, you may already have used your account in previous semesters and in other courses. If you carry around any form of mobile technology on campus, you also used this account to access the campus Wi-Fi network.

Unfortunately we don't have a simple way to collect all of the gmail/hotmail/yahoo/etc email accounts students already have, so during the semester it is important that you check your university email account on a regular basis.

You may contact Information Services directly at the IT Support Centre in the Archer Library. The IT Support Centre staff will be a valuable resource during CS110 and the balance of your studies. You need to contact your class or lab instructor if you have questions about CS110 lab or course content. However, if your e-mail stops working, for example, or you have trouble installing the free software provided by Information Services, contact the IT Support Centre for assistance.

Please return to the UR Courses home page and read the Syllabus. The mark distribution for CS110 is in the Syllabus as are the exam dates. You will be busy throughout the semester, learning more each week about programming. You'll hear me refer to "mental models" on occasion. This is a phrase from the domain of Human Computer Interaction, basically the problem domain of designing software that is easy to use. It involves what our past experience provides when we face a new environment. Designers of computer operating systems such as Windows or the Mac OS have long used a metafor for the office environment. For example, we store information in files that we keep in file folders. And, the colour of the icon for a file folder is almost always the colour of a Manila File Folder.

Unfortunately, you are not likely to have much experience that will assist you in understanding the concepts you will encounter in programming. I'll try to illustrate experiences that will help you appreciate that many of the artifacts in a programming language are simple implementations of tools that you have used before. For example, arrays often seem totally foreign when first encountered. But, the use of a spreadsheet to hold rows of numbers, say class marks, may be a past experience that can help you understand that this is all that we are doing in using an array to hold numbers in a program. Everyone understands how to find their seat after purchasing a ticket for an assigned seating event. Eventually you find your row and seat. In an array, we have row and column indices (remember the rows and columns of the spreadsheet) to keep track of where we are in the array. Sometimes, you just have to say to yourself, "right, what else would you use?"

Background:

Please be sure to read the

Introduction to Programming with C++ text on a regular basis along with writing code. Do the examples and try the Programming Exercises. This is a discipline where skill is acquired only by regular practice. There are other books available at the Library's collection of E-Books. Do a search for C++ in the Safari book collection.

Most of the class will be quite familiar with using a computer, creating folders, navigating the Web, or obtaining a bit of Cloud storage space using Dropbox, SkyDrive or the equivalent. The computer background material in Chapter 1 may not be as familiar but we will move on quickly to the main issue of problem solving and translating problem solutions into a language, C/C++, that we use to have the work done by a machine. While the intent of the class is to enhance your skills at analysing problems and designing solutions, this intent is going to seem secondary to learning the syntax requirements of the C/C++ programming language as we start. We will move from syntax to semantics and the expression of our problem solutions as the semester progresses.

[TIP: If your browser didn't follow the links just above, then try right-clicking on a link and selecting "Open Link in New Window" to see if that works. This isn't always necessary but can be a side-effect of how different browsers work with UR Courses.]

The CS110 lab in CL135.4 uses the Windows 7 operating system and provides Visual Studio 2010. I am a diehard Mac fan. I normally run Windows under Parallels on a Mac. However, I'm using BootCamp on a Mac Air this semester as it seemed like a simpler way to access Windows during class time. Now that you're wondering what I'm talking about, the relevant message is that I'll provide some advice in these notes about which platform you might use this semester. However, when it comes to more difficult questions, such as "It worked yesterday, what happened?" then seeing me during office hours will give me time to dig a bit.

The issue of what you will chose to use is considerably more complicated than the era when I took my first programming class. The programming languages were arguably simpler although they needed to be surrounded by cards containing Job Control Language (JCL) that specified what you wanted done with the program. The program was punched onto cards using an IBM 029 Key Punch. At least we didn't have to decide if we wanted to use the Visual Studio IDE or a simple text editor combined with uploading our files. It was just a matter of whether a key punch was free and figuring out the JCL which tended to be complex and often more a matter of just using it rather than understanding it. You'll find that aspect of programming hasn't disappeared when you read about "using namespace std" in your programs. On page 15 you'll be told to just add the phrase to your programs. That introduces a problem that we will encounter during the semester. We'd like to focus on problem solving and the basics of programming. However, we are using a programming language designed for more complex environments than obtaining a basic understanding of computational thought and design. The "using namespace std" simplifies the use of the "cout" function at the cost of not explaining the naming of functions in libraries. If you want to convince yourself that this is a wise approach, look at a few brief comments or search for the phrase "using namespace std" to find many arguments for and against the approach taken in the text.

References

More detailed version of PDP-11 Macro-11 Assembly Language for "Hello, world"


Toolset:

C++ Compilation

The CS110 labs provide details on several options for compiling C++. These notes won't duplicate the lab material but will provide references that may (should?) be of interest. Why "may" instead of "should?" I'd like CS110 to be an experience where you acquire an understanding of a form of problem analysis and solution design that you may not have experienced before. The problem is that this is going to almost be as bad as taking an introductory biology course. You know that biology deals with fascinating subject material but that first course feels like you have to memorize a zillion unconnected facts. It won't be quite that bad but we are going to mention several options for the tools needed to compile and run a C++ program. We don't actually care which toolset you use as long as you can edit a C++ file (a text file that has the extension .cpp), compile this file (people and companies are literally giving away C++ compilers), and run the compiled program (we need to see that it works).


Resource files for Chapter 1


pocketcpp option

Notepad++ is a popular and free Notepad replacement. Have a look at this YouTube video about Notepad++ to see if you are interested.

pocketcpp, Notepad++ combined with a C++ compiler (GCC 4.8.1), might be of interest. It is certainly a quick and simple way for Windows users to edit and test programs.





Compiling on Hercules

login remotely, in this case, from a Mac using the builtin terminal application

compile and then run the program


More detailed diagram of why we include header files


Tutorials and Sources of Information on C++

As you begin to learn how to use C++ and encounter a good resource, please share the information in the Discussion Forum or email the information to me so that I post it for everyone's benefit.

  • cplusplus.com: This is a nice site with tutorials that are well done and line up nicely with the early textbook coverage.
  • tutorialspoint.com: The "Try it" Option is a nice feature that allows you to run examples online as you learn about C++.

Style sheet source

These notes are copyright R.B. Maguire. They are intended for the use of the classes which I am teaching and may not be used for other purposes without my express written permission.