Programming Fundamentals: Modular Programming, Loops, and Arrays, Study Guides, Projects, Research of Software Engineering

A comprehensive overview of fundamental programming concepts, including modular programming with functions, parameters, and return values. It covers iteration control structures such as while loops, do-while loops, and for loops, along with nested loops. Additionally, it explores array processing techniques, including display, total, max, min, parallel arrays, sort, fixed arrays, dynamic arrays, and multidimensional arrays, with examples in multiple programming languages. This resource is designed to help students understand and implement these core concepts in their programming projects, offering practical insights and code examples.

Typology: Study Guides, Projects, Research

2024/2025

Uploaded on 10/09/2025

ismaeel-khan-1
ismaeel-khan-1 🇵🇰

2 documents

1 / 563

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Programming Fundamentals
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Programming Fundamentals: Modular Programming, Loops, and Arrays and more Study Guides, Projects, Research Software Engineering in PDF only on Docsity!

Programming Fundamentals

Programming Fundamentals by Authors and Contributors is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, except where otherwise noted. Creative Commons Attribution CC-BY License You are free to:

  • Share — copy and redistribute the material in any medium or format
  • Adapt — remix, transform, and build upon the material for any purpose, even commercially. Under the following terms:
  • Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. See https://creativecommons.org/licenses/by/4.0/ for more information.

Contents

Contents xv About this Book 1 Author Acknowledgements 5

Chapter I. Introduction to

Programming

Systems Development Life Cycle Kenneth Leroy Busbee

Program Design Kenneth Leroy Busbee

Program Quality Dave Braunschweig

Pseudocode Kenneth Leroy Busbee

Flowcharts Kenneth Leroy Busbee

Software Testing Kenneth Leroy Busbee

Integrated Development Environment Kenneth Leroy Busbee

Version Control Dave Braunschweig

Input and Output Kenneth Leroy Busbee

Arithmetic Operators 121 Integer Division and Modulus Kenneth Leroy Busbee

Unary Operations Kenneth Leroy Busbee

Lvalue and Rvalue Kenneth Leroy Busbee

Data Type Conversions 138 Input-Process-Output Model Dave Braunschweig

C++ Examples Dave Braunschweig

C# Examples Dave Braunschweig

Java Examples Dave Braunschweig

JavaScript Examples Dave Braunschweig

Python Examples Dave Braunschweig

Swift Examples Dave Braunschweig

Practice: Data and Operators 177

Chapter III. Functions

Modular Programming 183 Hierarchy or Structure Chart Kenneth Leroy Busbee

Function Examples Dave Braunschweig

Parameters and Arguments Dave Braunschweig

Call by Value vs. Call by Reference Dave Braunschweig

Return Statement Dave Braunschweig and Kenneth Leroy Busbee

Void Data Type 206 Scope Kenneth Leroy Busbee

Programming Style 211 Standard Libraries 217 Program Plan 221 C++ Examples Dave Braunschweig

C# Examples Dave Braunschweig

Java Examples Dave Braunschweig

JavaScript Examples Dave Braunschweig

Python Examples Dave Braunschweig

Swift Examples Dave Braunschweig

Practice: Functions 235

Chapter IV. Conditions

Structured Programming 241 Selection Control Structures 245

Chapter V. Loops

Iteration Control Structures 315 While Loop Kenneth Leroy Busbee

Do While Loop 325 Flag Concept Kenneth Leroy Busbee

For Loop Kenneth Leroy Busbee

Branching Statements Kenneth Leroy Busbee

Increment and Decrement Operators Kenneth Leroy Busbee

Integer Overflow Kenneth Leroy Busbee

Nested For Loops Kenneth Leroy Busbee

Program Plan 356 Loop Examples Dave Braunschweig

C++ Examples Dave Braunschweig

C# Examples Dave Braunschweig

Java Examples Dave Braunschweig

JavaScript Examples Dave Braunschweig

Python Examples Dave Braunschweig

Swift Examples Dave Braunschweig

Practice: Loops Kenneth Leroy Busbee

Chapter VI. Arrays

Arrays and Lists 389 Index Notation 393 Displaying Array Members 397 Arrays and Functions 400 Math Statistics with Arrays 403 Searching Arrays 406 Sorting Arrays 409 Parallel Arrays Dave Braunschweig

Multidimensional Arrays Kenneth Leroy Busbee

Fixed and Dynamic Arrays Dave Braunschweig

Program Plan 420 C++ Examples Dave Braunschweig

C# Examples Dave Braunschweig

Java Examples Dave Braunschweig

JavaScript Examples Dave Braunschweig

Exception Handling 507

Chapter VIII. Object-Oriented

Programming

Objects and Classes Dave Braunschweig

Encapsulation Dave Braunschweig

Inheritance and Polymorphism Dave Braunschweig

C++ Examples Dave Braunschweig

C# Examples Dave Braunschweig

Java Examples Dave Braunschweig

JavaScript Examples Dave Braunschweig

Python Examples Dave Braunschweig

Swift Examples Dave Braunschweig

Practice Kenneth Leroy Busbee

About this Book

A Note to Readers

Welcome to Programming Fundamentals – A Modular Structured Approach, 2nd Edition! The original content for this book was created by Kenneth Leroy Busbee and written specifically for his course based on C++. The goal for this second edition is to make it programming-language neutral, so that it may serve as an introductory programming textbook for students using any of a variety of programming languages, including C++, C#, Java, JavaScript, Python, and Swift. Other languages will be considered upon request. Programming concepts are introduced generically, with logic demonstrated in pseudocode and flowchart form, followed by examples for different programming languages. Emphasis is placed on a modular, structured approach that supports reuse, maintenance, and self-documenting code. As you begin to review this edition, please keep the audience in mind. If something is missing, think about whether that concept applies to programming in general or only to certain programming languages, and whether it is a About this Book | 1

Structures. This textbook/collection covers the first of those three courses. Learning Modules The learning modules of this textbook were written as standalone modules. Students using a collection of modules as a textbook will usually view its contents by reading the modules sequentially as presented by the author of the collection. However, many readers of these modules may find them as a result of an Internet search. The textbook design allows the author of a module to create web links to other modules and Internet locations and designate any necessary prerequisites. Conceptual Approach The learning modules of this textbook were, for the most part, written without consideration of a specific programming language. Concepts are presented generically, with program logic demonstrated first in pseudocode and flowchart format. Language-specific examples follow the general overview. Re-use and Customization The Creative Commons (CC) Attribution-ShareAlike license applies to all modules in this textbook. Under this license, any module may be used or modified for any purpose as long as proper attribution to the original author(s) is About this Book | 3

maintained and you distribute your contributions under the same license. PDF Conversion Problems There are several known PDF printing problems. A description of the known problems are:

  1. When it converts an “Example” the PDF displays the first line of an example properly but indents the remaining lines of the example. This problem occurs for the printing of a book (because it prints a PDF) and downloading either a module or a textbook/collection as a PDF.
  2. Within C++ there are three operators that do not convert properly into PDF format. decrement — which is two minus signs insertion << which is two less than signs extraction >> which is two greater than signs References
  • archive.org: Programming Fundamentals – A Modular Structured Approach using C++ 4 | About this Book