Skip to Content
Programming: Principles and Practice Using C++, 3rd Edition
book

Programming: Principles and Practice Using C++, 3rd Edition

by Bjarne Stroustrup
April 2024
Beginner
656 pages
23h 19m
English
Addison-Wesley Professional
Content preview from Programming: Principles and Practice Using C++, 3rd Edition

6

Completing a Program

Keep it simple: as simple as possible, but no simpler.

– Albert Einstein

Writing a program involves gradually refining our ideas of what we want to do and how we want to express it. In Chapter 5, we produced the initial working version of a calculator program. Here, we’ll refine it. Completing the program – that is, making it fit for users and maintainers – involves improving the user interface, doing some serious work on error handling, adding a few useful features, and restructuring the code for ease of understanding and modification.

§6.1 Introduction

§6.2 Input and output

§6.3 Error handling

§6.4 Negative numbers

§6.5 Remainder: %

§6.6 Cleaning up the code

Symbolic constants. Use of functions. Code layout. Commenting ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming: Principles and Practice Using C++, 2nd Edition

Programming: Principles and Practice Using C++, 2nd Edition

Bjarne Stroustrup

Publisher Resources

ISBN: 9780138308667