To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
All programmers are optimists. Perhaps this modern sorcery especially attracts those who believe in happy endings and fairy godmothers. Perhaps the hundreds of nitty frustrations drive away all but those who habitually focus on the end goal.
Perhaps it is merely that computers are young, programmers are younger, and the young are always optimists. But however the selection process works, the result is indisputable: “This time it will surely run” or “I just found the last bug.”
–Fred Brooks
Programming is all about making the user happy. As a developer, your mission is to produce a product that fulfills a need for the user and makes them want to use your program. The easier you can make their computing experience, the better. That's a double-edged sword. Often, it's easier to make a program work than it is to keep the user happy. And, the more you try to please the ubiquitous end user, the harder it is for you as a developer. It's often said, “This whole software development thing would be a whole lot easier if it wasn't for all those end users.” While that may seem true, the computer industry wouldn't be where it is today without end users. They buy programs to make their work faster and easier and their fun more enjoyable. They're demanding, fussy, stubborn, and every year they spend billions on what works.
This chapter expands your knowledge of variables and their use. You'll get a taste of methods.
Think of a program as a play and you're the director. The actors are the controls and the code is your script. It's up to you to bring all of them together to make it work. Most actors can get the words right and learn to hit their marks, but there's far more to it than just memorizing lines and taking cues. As a developer you have to make your program – your play – flow and get all the parts to work together.
Most programs follow the same general path: declarations, input, processing, and output. That helps, but the hard part is getting a human to understand how the computer works. Usually, this understanding comes only from practice. To become a good programmer, you must write programs. To write good programs, you often must write lots of code. And the more code you write, the more mistakes you'll make. Mistakes are a good thing, though. Often, especially in programming, mistakes are a great way to learn. Just like a good director needs to rehearse lots of scenes and try them in many ways, a programmer has to learn what works and what doesn't. In programming, mistakes can be your ally. “OK, this worked, but what if I try this?” “What happens if…?”
I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone.
–Bjarne Stroustrup
Life is filled with repetition. And every once in a while it throws you for a loop. Every day and every week has a routine. For example, chores are a series of often mundane tasks that get repeated time and again. Make your bed, take out the garbage, walk the dog, do the dishes. That's why they're chores. You've probably reduced these tasks to a series of steps and then repeated them as needed. Business is much the same. The steps to calculate the weekly pay are pretty much the same for every employee. So is the process for calculating a bill or determining a student's grade. Once you know the proper steps for a process, it's easy to repeat them. However, if you can get the computer to do these tasks, it will be much faster and cheaper. And, it would free you to do more pleasant and important tasks.
Until now, the only way for the computer to repeat these tasks was by clicking on a Button over and over. That's slow and hard and boring. This chapter covers repetition structures – in programming parlance, loops. With them, a series of commands can be repeated. Some loops run a specified number of times.
The best thing about a Boolean is even if you are wrong, you are only off by a bit.
– Anonymous
What Are Decision Structures?
Decision structures give the computer a brain. Sort of. So far, every program has followed a sequence of commands. Every command has executed, in order, when needed. That's great if you're riding the kiddie cars at the carnival, but you want some real power and the ability to make your own decisions. Think open road, the wind in your face, and the power to take whatever road suits your fancy. That's where If and Case statements come in. Quite literally you'll be able to pick one path or the other with an If statement. With a Case statement, you'll be able to choose one path from many. Are you hungry? Do you need gas? Then stop. It's your decision. Without them, you're merely a passenger on the bus and someone else makes all the decisions. With them, you turn the computer from a calculator that can only solve one problem into a thinking machine that can make decisions for various outcomes based on the input provided and the directions given to it by the developer. In short, you're on your way to teaching the computer how to think.
If…Then…Else Structures
Decision structures give the computer multiple blocks of code and the ability to select the block of code to execute.
This book is written for the newbie. It's not for those who already know programming. If you know the basics of the computer, like word processing, spreadsheets, email, and surfing, then you're ready to go.
What's Included?
This book covers the basics, like variable and assignment statements. It explains programming sequence, selection, and repetition structures – fundamentals to the design of any good program. It explains controls and their uses, the basic tools for designing your interface. Procedures and functions are covered, which are the basic building blocks of larger programs. File input and output (I/O) is introduced. Good programs run on data and I/O is how data get into and out of the computer. From there, arrays are introduced and used to implement more complicated programming logic including control breaks, sorting, and searching. Events make things happen in a program and one chapter is dedicated to events, including drag and drop. Objects are introduced and an understanding of them is crucial for successful developers. For a little fun, there's a chapter on graphics and sound, but you'll need a good foundation in programming sequence, logic, and repetition to get the most from it. The world runs on databases and the last two chapters cover the basics of databases, including an introduction to LINQ to SQL and Crystal Reports. LINQ connects programs to databases. SQL (Structured Query Language) is designed to find, update, and report data, and Crystal Reports is designed for data presentation.
Man is still the most extraordinary computer of all.
– John F. Kennedy
The world runs on databases. Data of all kinds are tracked and stored, managed, massaged, manipulated, and, sometimes mangled. You got of taste of that in the last chapter. You even saw a little of it with control breaks back in Chapter 9. A report is the key tool for managing data. With a report, data become information, a list of numbers becomes a total or an average, and meaningless figures become a report, complete with a colored chart. Crystal Reports is a full-featured database reporting tool from Business Objects®. It crunches the numbers and produces printable reports. It's one of literally hundreds of third-party add-ons for Visual Studio. It handles data from almost any database and integrates it into reports.
VB Tip
Crystal Reports works with the Professional version of Visual Studio. It will not work with the Express Edition. A thirty-day free trial of Crystal Reports is available from SAP at http://www.sap.com/solutions/sapbusinessobjects/index.epx
Crystal Reports Tutorial
VB Tip
Place the database files in a folder on your hard drive called C:\CRFiles. That makes your reports easily portable.
Be sure to use the Professional version of Visual Studio and have either the trial version or the full version of Crystal Reports installed on your system. Make sure the TouristStops.mdb database is in the C:\CRFiles folder on your system. TouristStops is an Access database that contains information on vacation spots throughout the United States.
Various problems in computer science are 'hard', that is NP-complete, and so not realistically computable; thus in order to solve them they have to be approximated. This book is a survey of the basic techniques for approximating combinatorial problems using parallel algorithms. Its core is a collection of techniques that can be used to provide parallel approximations for a wide range of problems (for example, flows, coverings, matchings, travelling salesman problems, graphs), but in order to make the book reasonably self-contained, the authors provide an introductory chapter containing the basic definitions and results. A final chapter deals with problems that cannot be approximated, and the book is ended by an appendix that gives a convenient summary of the problems described in the book. This is an up-to-date reference for research workers in the area of algorithms, but it can also be used for graduate courses in the subject.
This book is a complete account of the predicate transformation calculus semantics of sequential programs, including repetitions, recursive procedures, computational induction and unbounded nondeterminacy. Predicate transformation semantics are the best specification method for the development of correct and well-structured computer programs. The author develops this theory to a greater depth than has been achieved before, and describes it in a way that makes it readily compatible with programming rules for partial and total correctness of repetitions and recursive procedures, supplies new rules for proving incorrectness, and a stronger rule for proving that two programs satisfy the same specifications. Finally, the semantics are extended so that non-terminating programs can be specified as well. This will be essential reading for all computer scientists working in specification and verification of programs.
Scott Ambler, award-winning author of Building Object Applications that Work, Process Patterns, and More Process Patterns, has revised his acclaimed first book, The Object Primer. Long prized in its original edition by both students and professionals as the best introduction to object-oriented technology, this book has all modeling notation rewritten in UML 2.0. All chapters have been revised to take advantage of Agile Modeling (AM), which is presented in the new chapter 2 along with other important modeling techniques. Review questions at the end of each chapter allow readers to test their newly acquired knowledge. In addition, the author takes time to reflect on the lessons learned over the past few years by discussing the proven benefits and drawbacks of the technology. This is the perfect book for any software development professional or student seeking an introduction to the concepts and terminology of object technology.
This book teaches model-based analysis and model-based testing, with important new ways to write and analyze software specifications and designs, generate test cases, and check the results of test runs. These methods increase the automation in each of these steps, making them more timely, more thorough, and more effective. Using a familiar programming language, testers and analysts will learn to write models that describe how a program is supposed to behave. The authors work through several realistic case studies in depth and detail, using a toolkit built on the C# language and the .NET framework. Readers can also apply the methods in analyzing and testing systems in many other languages and frameworks. Intended for professional software developers including testers, and for university students, this book is suitable for courses on software engineering, testing, specification, or applications of formal methods.
The fundamental ideas concerning computation and recursion naturally find their place at the interface between logic and theoretical computer science. The contributions in this book, by leaders in the field, provide a picture of current ideas and methods in the ongoing investigations into the pure mathematical foundations of computability theory. The topics range over computable functions, enumerable sets, degree structures, complexity, subrecursiveness, domains and inductive inference. A number of the articles contain introductory and background material which it is hoped will make this volume an invaluable resource.
Almost all of the problems studied in this book are motivated by an overriding foundational question: What are the appropriate axioms for mathematics? Through a series of case studies, these axioms are examined to prove particular theorems in core mathematical areas such as algebra, analysis, and topology, focusing on the language of second-order arithmetic, the weakest language rich enough to express and develop the bulk of mathematics. In many cases, if a mathematical theorem is proved from appropriately weak set existence axioms, then the axioms will be logically equivalent to the theorem. Furthermore, only a few specific set existence axioms arise repeatedly in this context, which in turn correspond to classical foundational programs. This is the theme of reverse mathematics, which dominates the first half of the book. The second part focuses on models of these and other subsystems of second-order arithmetic.
Linear logic, introduced in 1986 by J.-Y. Girard, is based upon a fine grain analysis of the main proof-theoretical notions of logic. The subject develops along the lines of denotational semantics, proof nets and the geometry of interaction. Its basic dynamical nature has attracted computer scientists, and various promising connections have been made in the areas of optimal program execution, interaction nets and knowledge representation. This book is the refereed proceedings of the first international meeting on linear logic held at Cornell University, in June 1993. Survey papers devoted to specific areas of linear logic, as well as an extensive general introduction to the subject by J.-Y. Girard, have been added, so as to make this book a valuable tool both for the beginner and for the advanced researcher.
Constraint Handling Rules (CHR) is both a theoretical formalism based on logic and a practical programming language based on rules. This book, written by the creator of CHR, describes the theory of CHR and how to use it in practice. It is supported by a website containing teaching materials, online demos, and free downloads of the language. After a basic tutorial, the author describes in detail the CHR language and discusses guaranteed properties of CHR programs. The author then compares CHR with other formalisms and languages and illustrates how it can capture their essential features. Finally, larger programs are introduced and analyzed in detail. The book is ideal for graduate students and lecturers, and for more experienced programmers and researchers, who can use it for self-study. Exercises with selected solutions, and bibliographic remarks are included at the ends of chapters. The book is the definitive reference on the subject.
How can we make sure that the software we build does what it is supposed to? This book provides an insight into established techniques which help developers to overcome the complexity of software development by constructing models of software systems in early design stages. It uses one of the leading formal methods, VDM (Vienna Development Method), and combines training in the formalism with industry-strength tool support and examples derived from real industrial applications. The principles taught here also apply to many of the current generation of formal methods. This second edition has been updated to include advanced online tool support for formal modelling as well as up-to-date reports on real commercial applications in areas as diverse as business information systems and firmware design.
The Annual European Meeting of the Association for Symbolic Logic, also known as the Logic Colloquium, is among the most prestigious annual meetings in the field. The current volume, with contributions from plenary speakers and selected special session speakers, contains both expository and research papers by some of the best logicians in the world. The most topical areas of current research are covered: valued fields, Hrushovski constructions (from model theory), algorithmic randomness, relative computability (from computability theory), strong forcing axioms and cardinal arithmetic, large cardinals and determinacy (from set theory), as well as foundational topics such as algebraic set theory, reverse mathematics, and unprovability. This volume will be invaluable for experts as well as those interested in an overview of central contemporary themes in mathematical logic.
Structured methodologies are a popular and powerful tool in information systems development. Many different ones exist, each employing a number of models and so a specification must be converted from one form to another during the development process. To solve this problem, Dr Tse proposes in this 1991 book a unifying framework behind popular structured models. He approaches the problem from the viewpoints of algebra and category theory. He not only develops the frameworks but also illustrates their practical and theoretical usefulness. Thus this book will provide insight for software engineers into how methodologies can be formalised and will open up a range of applications and problems for theoretical computer scientists.