ebook img

Programming and problem solving with ADA 95 PDF

951 Pages·2000·5.17 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Programming and problem solving with ADA 95

Programming and Problem Solving with Ada 95 Second Edition Programming and Problem Solving with Ada 95 Second Edition Nell Dale University of Texas, Austin Chip Weems University of Massachusetts, Amherst John McCormick University of Northern Iowa, Cedar Falls World Headquarters Jones and Bartlett Publishers Canada Jones and Bartlett Publishers International Jones and Bartlett Publishers 2406 Nikanna Road Barb House, Barb Mews 40 Tall Pine Drive Mississauga, Ontario London W6 7PA Sudbury, MA 01776 CANADA L5C 2WG UK 978-443-5000 [email protected] www.jbpub.com CHIEF EXECUTIVE OFFICER: Clayton Jones CHIEF OPERATING OFFICER: Don W. Jones, Jr. V.P., SALES AND MARKETING: Tom Manning V.P., COLLEGE EDITORIAL DIRECTOR: Brian L. McKean V.P., MANAGING EDITOR: Judith H. Hauck V.P., DESIGN AND PRODUCTION: Anne Spencer NATIONAL SALES MANAGER: Paul Shepardson SENIOR MARKETING MANAGER: Jennifer M. Jacobson SENIOR ACQUISITIONS EDITOR: J. Michael Stranz PRODUCTION EDITOR: Rebecca S. Marks DIRECTOR OF MANUFACTURING AND INVENTORY CONTROL: Therese Bräuer COVER DESIGN: Stephanie Torta TEXT DESIGN: George McLean COMPOSITION: PageMasters & Company PRINTING AND BINDING: Courier Companies COVER PRINTING: Courier Companies Copyright 2000 by Jones and Bartlett Publishers, Inc. All rights reserved. No part of the material protected by this copyright notice may be reproduced or utilized in any form, electronic or mechanical, including photocopying, recording, or any information storage or retrieval system, with- out written permission from the copyright owner. Library of Congress Cataloging-in-Publication Data Dale, Nell B. Programming and problem solving with ADA / Nell Dale, Chip Weems, John McCormick.—2nd ed. p. cm. Includes index. ISBN: 0-7637-0792-9 1. Ada (Computer program language) I. Weems, Chip II. McCormick, John (John W.) III. Title. QA76.73.A35 D36 2000 005.13'3—dc21 99-049488 Printed in the United States of America 04 03 02 01 00 10 9 8 7 6 5 4 3 2 1 This book is dedicated to you, and to all of our students, for whom it was begun and without whom it could never have been completed. N. D. C. W. J. M. To Naomi, wife and best friend. J. M. Contents PREFACE xxi ACKNOWLEDGMENTS xxix 1 OVERVIEW OF PROGRAMMING AND PROBLEM SOLVING 1 Overview of Programming 2 What Is Programming? 2 What Is a Computer? 3 Background Information: Mainframes, Micros, and Minis 9 How Do We Write a Program? 13 Theoretical Foundations: Data Representation 18 What Is a Programming Language? 19 Problem-Solving Techniques 23 Ask Questions 25 Look for Things That Are Familiar 25 Solve by Analogy 26 Means-Ends Analysis 27 Divide and Conquer 27 The Building-Block Approach 28 Merging Solutions 29 How to Start 29 Algorithmic Problem Solving 30 Software Engineering 30 Programming at Many Scales 31 viii Contents The Ada Programming Language 33 Background Information: The Origins of Ada 35 Problem-Solving Case Study: A Company Payroll 37 Summary 42 Quick Check 43 Answers 44 Exam Preparation Exercises 44 Programming Warm-up Exercises 46 2 ADA SYNTAX, SEMANTICS, AND THE PROGRAM DEVELOPMENT PROCESS 47 The Elements of Ada Programs 48 Syntax and Semantics 48 Identifiers 51 Matters of Style: Using Meaningful, Readable Identifiers 53 Data Types 53 Background Information: Data Storage 54 Declarations 57 Software Engineering Tip: Using Constants 60 Executable Statements 62 Output: Packages and Procedures 68 Commenting a Program 71 Background Information: Ada Lovelace 72 Program Construction 74 Program Entry, Correction, and Execution 76 Entering a Program 76 Compiling and Running a Program 77 Debugging 78 Software Engineering Tip: Understanding Before Changing 79 More About Expressions 79 Precedence Rules 80 Static Expressions 83 Type Conversions 83 Background Information: Strongly Typed Languages 84 Formatting Output 85 Line Spaces and Blanks 85 Contents ix Integer Numbers 86 Float Numbers 87 Matters of Style: Program Layout 89 The Use Package Clause 90 Problem-Solving Case Study: Mileage 94 Problem-Solving Case Study: Filling Down Comforters 97 Testing and Debugging 101 Testing and Debugging Hints 102 Summary 102 Quick Check 103 Answers 105 Exam Preparation Exercises 106 Programming Warm-up Exercises 111 Programming Problems 114 3 INPUT AND DESIGN METHODOLOGY 117 Getting Data into Programs 118 Input of Numeric Data 118 Input of String Data 121 Theoretical Foundations: More About Procedures and Parameters 124 String Slices 125 Input of Mixed Data Types 129 File Input/Output 138 Background Information: Charles Babbage 143 Programming Methodology 145 Top-Down Design 145 Object-Oriented Design 152 Software Engineering Tip: Documentation 153 Problem-Solving Case Study: Mixing Proportions 154 Testing and Debugging 159 Testing and Debugging Hints 160 Summary 161 Quick Check 162 Answers 162 Exam Preparation Exercises 162 Programming Warm-up Exercises 164 Programming Problems 166

Description:
Programming and Problem Solving with Ada 95 provides a solid introduction to programming while introducing the capabilities of Ada 95 and its syntax without overwhelming the student. The book focuses on the development of good programming habits. This text offers superior pedagogy that has long defi
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.