C# FOR STUDENTS

DOUGLAS BELL AND MIKE PARR

PLANNING A COURSE ON C#

About this book

For Instructors

More books by us

For Students

Contents

Preface

Sample Chapters

Download C# system, and code

Bonus Database Chapter

Approach

If you've decided to use C# for Students, you have probably also decided to:
  • use GUI's from the start (more fun and more current than command line)
  • use graphics fairly extensively (more fun, more dynamic than text only)
  • use objects early on
  • delay writing objects a little (until after the basics have been covered)

Information on the Libraries

When you use a modern language such as C#, you clearly need to spend time learning the language but equally you have to learn about the libraries - because most of the functionality is provided by the libraries. Having access to good clear information about the libraries can be a problem, we feel. There are the following sources:
  • appendix A of the book, provided for just this purpose
  • the help system
We also find that students sometimes get confused about what is a C# keyword and what is a library method. To assist, appendix B lists all the keywords. Also at the end of each chapter the newly-introduced keywords are listed. Novices? The book is aimed at novices, so it spends quite some time on basic control structures and on using methods. For more experienced students, you could romp through the early material quite quickly, while the students would probably enjoy creating GUI's and the associated event handling. You might well be used to fitting course within a semester structure. Here in England a semester lasts about 12 to 15 weeks, or roughly half the academic year. We think that there's too much in the book for a single semester of 1 lecture per week. There are a lot of ideas that would need to be understood in a short elapsed time. So we tend to think that there is a course on basic topics (see below), then a course on advanced topics (see below). It can be difficult to distinguish between what topics are basic and which are advanced. The partitioning we have used is simply our view, and we recognize that there are other views.

Practical work

We believe that practical work is vital in learning programming. To be realistic, there usually isn't enough time for students to attempt more than 2 or 3 exercises each week from the end-of-chapter exercises. We suggest that you choose the ones that seem most fun.

Arrays or not?

Covering arrays has always been part of a course in programming. For this purpose we have provided chapters on one-dimensional arrays and on two-dimensional arrays. But there is an alternative. We feel that arrays are becoming less important, as other data structures - such as lists, stacks, queues - become part of the standard armoury of modern programming languages. We have successfully introduced students to the idea of a list (and data structures in general) using the C# list box component (chapter 13), instead of using arrays. We feel that this has great appeal to the students because it is a data structure that is immediately visible.

On the other hand, you could do both arrays and list boxes.

Calculations

Chapter 12 explains how to do non-trivial calculations in C#.

If your students are information system students or more business oriented, the week could be spent on doing financial calculations (chapter 12).

Alternatively, if your students are mathematical, scientific or engineering, the week could be spent on numerical calculations (see also chapter 12).

A Course

Reminder: aimed at students new to programming. Uses one chapter each week. Runs over 2 semesters We feel that this is a fairly demanding schedule. Some topics could be easily omitted if time is short. Candidates include data structures, arrays and strings.

Testing, debugging and program style could be collapsed to a smaller time scale.

First Semester

weektopicchapter
1Introduction to C# 1
2Using the C# IDE2
3Introductory graphics3
4Variables and Calculations4
5Methods and parameters - part 15
6Methods and Parameters - part 25
7Using Objects6
8 Decisions - if, etc7
9Repetition - for, while, etc8
10Debugging9
11Writing Classes10
12Calculations12
13Data Structures - list boxes13

Second Semester

A second semester course aimed at students who have completed the novice course in semester 1.

Some of these ideas - like polymorphism - are challenging, we think. So students need some time to understand them.

weektopicchapter
1inheritance 11
2One dimensional arrays14
3Two dimensional arrays              15
4Strings16
5exceptions17
6files18
7console programs19
8OO design20
9Program style21
10Testing22
11Interfaces23
12Polymorphism24

Best wishes for successful and enjoyable teaching.