Sams Teach Yourself C in 21 Days

(singke) #1

Contents xix



  • Introduction

  • Week 1 At a Glance

    • Day 1 Getting Started with C

      • Type and Run

      • 2 The Components of a C Program

      • 3 Storing Information: Variables and Constants

      • 4 Statements, Expressions, and Operators

        • Type and Run



      • 5 Functions: The Basics

      • 6 Controlling Your Program’s Order of Execution

      • 7 Fundamentals of Reading and Writing Information





  • Week 1 In Review

  • Week 2 At a Glance

    • 8 Using Numeric Arrays

    • 9 Understanding Pointers

      • Type and Run



    • 10 Working with Characters and Strings

    • 11 Implementing Structures, Unions, and TypeDefs

    • 12 Understanding Variable Scope

      • Type and Run



    • 13 Advanced Program Control

    • 14 Working with the Screen, Printer, and Keyboard



  • Week 2 In Review

  • Week 3 At a Glance

    • 15 Pointers: Beyond the Basics

    • 16 Using Disk Files

      • Type and Run



    • 17 Manipulating Strings

    • 18 Getting More from Functions

    • 19 Exploring the C Function Library

      • Type and Run



    • 20 Working with Memory

    • 21 Advanced Compiler Use



  • Week 3 In Review

  • Bonus Week at a Glance

    • Bonus Day 1 Objected-Oriented Programming Languages

    • Bonus Day 2 The C++ Programming Language

    • Bonus Day 3 Working with C++ Classes and Objects

    • Bonus Day 4 The Java Programming Language

    • Bonus Day 5 Programming Java Applets

    • Bonus Day 6 Building a Java Applet

    • Bonus Day 7 The C# Programming Languages



  • Bonus Week in Review

    • A ASCII Character Chart Appendixes

    • B C/C++ Reserved Words

    • C Working with Binary and Hexadecimal Numbers

    • D Portability Issues

    • E Common C Functions

      • F Answers



    • G Getting Started with Dev-C++

    • Index

      • Introduction Table of Contents

      • This Book’s Special Features ................................................................................

      • Making a Better Book ............................................................................................

      • The CD-Rom and the Book’s Code ........................................................................

      • Conventions Used in This Book ............................................................................





  • WEEK1ATAGLANCE

    • Where You’re Going ..............................................................................................

    • DAY 1 Getting Started with C

      • A Brief History of the C Language ........................................................................

      • Why Use C? ............................................................................................................

      • Preparing to Program ..............................................................................................

      • The Program Development Cycle ........................................................................

        • Creating the Source Code ................................................................................

        • Compiling the Source Code ............................................................................

        • Linking to Create an Executable File ..............................................................

        • Completing the Development Cycle ..............................................................



      • Your First C Program ............................................................................................

        • Entering and Compiling hello.c ......................................................................



      • Summary ..............................................................................................................

      • Q&A ......................................................................................................................

      • Workshop ..............................................................................................................

        • Quiz ................................................................................................................

        • Exercises ..........................................................................................................





    • TYPE& RUN 1 Printing Your Listings

      • The First Type & Run ..........................................................................................

      • DAY 2 The Components of a C Program

        • A Short C Program ..............................................................................................

        • The Program’s Components ................................................................................

          • Themain()Function (Lines 8 Through 23) ....................................................

          • The#includeDirective (Line 2) ....................................................................

          • The Variable Definition (Line 4) ....................................................................

          • The Function Prototype (Line 6) ....................................................................

          • Program Statements (Lines 11, 12, 15, 16, 19, 20, 22, and 28) ....................





      • The Function Definition (Lines 26 Through 29) ............................................

      • Program Comments (Lines 1, 10, 14, 18, and 25) ..........................................

      • Using Braces (Lines 9, 23, 27, and 29) ..........................................................

      • Running the Program ......................................................................................

      • A Note on Accuracy ........................................................................................



    • A Review of the Parts of a Program ....................................................................

    • Summary ..............................................................................................................

    • Q&A ......................................................................................................................

    • Workshop ..............................................................................................................

      • Quiz ................................................................................................................

      • Exercises ..........................................................................................................





  • DAY 3 Storing Information: Variables and Constants

    • Understanding Your Computer’s Memory ............................................................

    • Storing Information with Variables ......................................................................

      • Variable Names ................................................................................................



    • Numeric Variable Types ........................................................................................

      • Variable Declarations ......................................................................................

      • ThetypedefKeyword ....................................................................................

      • Initializing Variables ........................................................................................



    • Constants ..............................................................................................................

      • Literal Constants ..............................................................................................

      • Symbolic Constants ........................................................................................



    • Summary ..............................................................................................................

    • Q&A ......................................................................................................................

    • Workshop ..............................................................................................................

      • Quiz ................................................................................................................

      • Exercises ..........................................................................................................



    • and Operators DAY 4 The Pieces of a C Program: Statements, Expressions,

    • Statements ............................................................................................................

      • The Impact of Whitespace on Statements ......................................................

      • Creating a Null Statements ..............................................................................

      • Working with Compound Statements ............................................................



    • Understanding Expressions ..................................................................................

      • Simple Expressions ........................................................................................

      • Complex Expressions ......................................................................................



    • Operators ..............................................................................................................

      • The Assignment Operator ................................................................................

      • The Mathematical Operators ..........................................................................

      • Operator Precedence and Parentheses ............................................................

      • Order of Sub-expression Evaluation ..............................................................

      • The Relational Operators ................................................................................

      • TheifStatement ..................................................................................................

        • TheelseClause ..............................................................................................



      • Evaluating Relational Expressions ......................................................................

        • The Precedence of Relational Operators ........................................................



      • The Logical Operators ..........................................................................................

      • More on True/False Values ..................................................................................

        • The Precedence of Operators ..........................................................................

        • Compound Assignment Operators ..................................................................

        • The Conditional Operator ................................................................................

        • The Comma Operator ......................................................................................



      • Operator Precedence Revisited ............................................................................

      • Summary ..............................................................................................................

      • Q&A ......................................................................................................................

      • Workshop ..............................................................................................................

        • Quiz ................................................................................................................

        • Exercises ..........................................................................................................







  • TYPE& RUN 2 Find the Number

    • DAY 5 Packaging Code in Functions

      • What Is a Function? ..............................................................................................

        • A Function Defined ........................................................................................

        • A Function Illustrated ......................................................................................



      • How a Function Works ......................................................................................

      • Functions and Structured Programming ............................................................

        • The Advantages of Structured Programming ................................................

        • Planning a Structured Program ....................................................................

        • The Top-Down Approach ..............................................................................



      • Writing a Function ..............................................................................................

        • The Function Header ....................................................................................

        • The Function Body ........................................................................................

        • The Function Prototype ................................................................................



      • Passing Arguments to a Function ......................................................................

      • Calling Functions ................................................................................................

        • Recursion ......................................................................................................



      • Where the Functions Belong ..............................................................................

      • Working with Inline Functions ..........................................................................

      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................





    • DAY 6 Basic Program Control

      • Arrays: The Basics ..............................................................................................

      • Controlling Program Execution ..........................................................................

        • TheforStatement ........................................................................................

        • NestingforStatements ................................................................................

        • ThewhileStatement ....................................................................................

        • NestingwhileStatements ..............................................................................

        • Thedo...whileLoop ..................................................................................



      • Nested Loops ......................................................................................................

      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................





    • DAY 7 Fundamentals of Reading and Writing Information

      • Displaying Information On-Screen ....................................................................

        • Theprintf()Function ................................................................................

        • Theprintf()Format Strings ........................................................................

        • Displaying Messages with puts()................................................................



      • Inputting Numeric Data with scanf()................................................................

      • Using Trigraph Sequences ..................................................................................

      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................







  • WEEK1 INREVIEW

  • WEEK2 ATAGLANCE

    • Where You’re Going ..........................................................................................

    • DAY 8 Using Numeric Arrays

      • What Is an Array? ..............................................................................................

        • Using Single-Dimensional Arrays ................................................................

        • Using Multidimensional Arrays ....................................................................



      • Naming and Declaring Arrays ............................................................................

        • Initializing Arrays ..........................................................................................

        • Initializing Multidimensional Arrays ............................................................

        • Maximum Array Size ....................................................................................



      • Summary ............................................................................................................

        • Q&A ....................................................................................................................

        • Workshop ............................................................................................................

          • Quiz ..............................................................................................................

          • Exercises ........................................................................................................





      • DAY 9 Understanding Pointers

        • What Is a Pointer? ..............................................................................................

          • Your Computer’s Memory ............................................................................

          • Creating a Pointer ..........................................................................................



        • Pointers and Simple Variables ............................................................................

          • Declaring Pointers ........................................................................................

          • Initializing Pointers ......................................................................................

          • Using Pointers ..............................................................................................



        • Pointers and Variable Types ................................................................................

        • Pointers and Arrays ............................................................................................

          • The Array Name as a Pointer ........................................................................

          • Array Element Storage ..................................................................................

          • Pointer Arithmetic ........................................................................................



        • Pointer Cautions ..................................................................................................

        • Array Subscript Notation and Pointers ..............................................................

        • Passing Arrays to Functions ..............................................................................

        • Summary ............................................................................................................

        • Q&A ....................................................................................................................

        • Workshop ............................................................................................................

          • Quiz ..............................................................................................................

          • Exercises ........................................................................................................









  • TYPE& RUN 3 Pausing for a Second or Two

    • DAY 10 Working with Characters and Strings

      • ThecharData Type ............................................................................................

      • Using Character Variables ..................................................................................

      • Using Strings ......................................................................................................

        • Arrays of Characters ......................................................................................

        • Initializing Character Arrays ........................................................................



      • Strings and Pointers ............................................................................................

      • Strings Without Arrays ......................................................................................

        • Allocating String Space at Compilation ........................................................

        • Themalloc()Function ................................................................................

        • Using the malloc()Function ........................................................................



      • Displaying Strings and Characters ....................................................................

        • Theputs()Function ....................................................................................

        • Theprintf()Function ................................................................................





    • Reading Strings from the Keyboard ..................................................................

      • Inputting Strings Using the gets()Function ................................................

      • Inputting Strings Using the scanf()Function ..............................................



    • Summary ............................................................................................................

    • Q&A ....................................................................................................................

    • Workshop ............................................................................................................

      • Quiz ..............................................................................................................

      • Exercises ........................................................................................................





  • DAY 11 Implementing Structures, Unions, and TypeDefs

    • Working with Simple Structures ........................................................................

      • Defining and Declaring Structures ................................................................

      • Accessing Members of a Structure ..............................................................



    • Using Structures That are More Complex ..........................................................

      • Including Structures Within Other Structures ..............................................

      • Structures That Contain Arrays ....................................................................



    • Arrays of Structures ............................................................................................

    • Initializing Structures ..........................................................................................

    • Structures and Pointers ......................................................................................

      • Including Pointers as Structure Members ....................................................

      • Creating Pointers to Structures ......................................................................

      • Working with Pointers and Arrays of Structures ..........................................

      • Passing Structures as Arguments to Functions ............................................



    • Understanding Unions ........................................................................................

      • Defining, Declaring, and Initializing Unions ................................................

      • Accessing Union Members ..........................................................................

      • typedef............................................................................................................ Creating Synonyms for Structures with



    • Summary ............................................................................................................

    • Q&A ....................................................................................................................

    • Workshop ............................................................................................................

      • Quiz ..............................................................................................................

      • Exercises ........................................................................................................





  • DAY 12 Understanding Variable Scope

    • What Is Scope? ..................................................................................................

      • A Demonstration of Scope ............................................................................

      • Why Is Scope Important? ..............................................................................



    • Creating External Variables ................................................................................

      • External Variable Scope ................................................................................

      • When to Use External Variables ....................................................................

      • TheexternKeyword ....................................................................................

      • Creating Local Variables ....................................................................................

        • Static Versus Automatic Variables ................................................................

        • The Scope of Function Parameters ..............................................................

        • External Static Variables ................................................................................

        • Register Variables ..........................................................................................



      • Local Variables and the main()Function ..........................................................

      • Which Storage Class Should You Use? ..............................................................

      • Local Variables and Blocks ................................................................................

      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................







  • TYPE& RUN 4 Secret Messages

    • DAY 13 Advanced Program Control

      • Ending Loops Early ............................................................................................

        • ThebreakStatement ....................................................................................

        • ThecontinueStatement ................................................................................



      • ThegotoStatement ............................................................................................

      • Infinite Loops ......................................................................................................

      • TheswitchStatement ........................................................................................

      • Exiting the Program ............................................................................................

        • Theexit()Function ....................................................................................

        • in a Program .................................................................................................... Executing Operating System Commands



      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................





    • DAY 14 Working with the Screen, Printer, and Keyboard

      • Streams and C ....................................................................................................

        • What Exactly Is Program Input/Output? ......................................................

        • What Is a Stream? ........................................................................................

        • Text Versus Binary Streams ..........................................................................

        • Predefined Streams ........................................................................................



      • Using C’s Stream Functions ..............................................................................

        • An Example ..................................................................................................



      • Accepting Keyboard Input ..................................................................................

        • Character Input ..............................................................................................

        • Working with Formatted Input ......................................................................



      • Controlling Output to the Screen ........................................................................

        • Character Output with putchar(),putc(), and fputc()..............................

        • Usingputs()andfputs()for String Output ..............................................

        • Usingprintf()andfprintf()for Formatted Output ................................



      • Redirecting Input and Output ............................................................................

        • Redirecting Input ..........................................................................................



      • When to Use fprintf()....................................................................................

        • Usingstderr................................................................................................



      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................







  • WEEK2 INREVIEW

  • WEEK3 ATAGLANCE

    • Where You’re Going ..........................................................................................

    • DAY 15 Pointers: Beyond the Basics

      • Declaring Pointers to Pointers ............................................................................

      • Pointers and Multidimensional Arrays ..............................................................

      • Working with Arrays of Pointers ........................................................................

        • Strings and Pointers: A Review ....................................................................

        • Declaring an Array of Pointers to Type char................................................

        • Pulling Things Together With an Example ..................................................



      • Working with Pointers to Functions ..................................................................

        • Declaring a Pointer to a Function ................................................................

        • Initializing and Using a Pointer to a Function ..............................................



      • Bonus Section: Understanding Linked Lists ......................................................

        • Basics of Linked Lists ..................................................................................

        • Working with Linked Lists ............................................................................

        • A Simple Linked List Demonstration ..........................................................

        • Implementing a Linked List ..........................................................................



      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................





    • DAY 16 Using Disk Files

      • Relating Streams to Disk Files ..........................................................................

      • Understanding the Types of Disk Files ..............................................................

      • Using Filenames ................................................................................................

      • Opening a File ....................................................................................................

      • Writing and Reading File Data ..........................................................................

        • Formatted File Input and Output ..................................................................

        • Character Input and Output ..........................................................................

        • Direct File Input and Output ........................................................................



      • File Buffering: Closing and Flushing Files ........................................................

      • Understanding Sequential Versus Random File Access ....................................

        • Theftell()andrewind()Functions ..........................................................

        • Thefseek()Function ..................................................................................



      • Detecting the End of a File ................................................................................

      • File Management Functions ..............................................................................

        • Deleting a File ..............................................................................................

        • Renaming a File ............................................................................................

        • Copying a File ..............................................................................................



      • Using Temporary Files ......................................................................................

      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................







  • TYPE& RUN 5 Counting Characters

    • DAY 17 Manipulating Strings

      • Determining String Length ................................................................................

      • Copying Strings ..................................................................................................

        • Thestrcpy()Function ................................................................................

        • Thestrncpy()Function ................................................................................

        • Thestrdup()Function ................................................................................



      • Concatenating Strings ........................................................................................

        • Using the strcat()Function ........................................................................

        • Using the strncat()Function ......................................................................



      • Comparing Strings ..............................................................................................

        • Comparing Two Entire Strings ......................................................................

        • Comparing Partial Strings ............................................................................

        • Comparing Two Strings While Ignoring Case ..............................................



      • Searching Strings ................................................................................................

        • Thestrchr()Function ................................................................................

        • Thestrrchr()Function ................................................................................



      • Thestrcspn()Function ................................................................................

      • Thestrspn()Function ................................................................................

      • Thestrpbrk()Function ................................................................................

      • Thestrstr()Function ................................................................................



    • String Conversions ..............................................................................................

    • Miscellaneous String Functions ..........................................................................

      • Thestrrev()Function ................................................................................

      • Thestrset()andstrnset()Functions ......................................................



    • String-to-Number Conversions ..........................................................................

      • Converting Strings to Integers ......................................................................

      • Converting Strings to Longs ..........................................................................

      • Converting Strings to Long Longs ................................................................

      • Converting Strings to Floating Point Numeric Values ..................................



    • Character Test Functions ....................................................................................

      • ANSI Support for Uppercase and Lowercase ..............................................



    • Summary ............................................................................................................

    • Q&A ....................................................................................................................

    • Workshop ............................................................................................................

      • Quiz ..............................................................................................................

      • Exercises ........................................................................................................





  • DAY 18 Getting More from Functions

    • Passing Pointers to Functions ............................................................................

    • TypevoidPointers ..............................................................................................

    • Using Functions That Have a Variable Number of Arguments ..........................

    • Functions That Return a Pointer ........................................................................

    • Summary ............................................................................................................

    • Q&A ....................................................................................................................

    • Workshop ............................................................................................................

      • Quiz ..............................................................................................................

      • Exercises ........................................................................................................





  • DAY 19 Exploring the C Function Library

    • Mathematical Functions ......................................................................................

      • Trigonometric Functions ..............................................................................

      • Exponential and Logarithmic Functions ......................................................

      • Hyperbolic Functions ....................................................................................

      • Other Mathematical Functions ......................................................................

      • A Demonstration of the Math Functions ......................................................



    • Dealing with Time ..............................................................................................

      • Representing Time ........................................................................................

      • The Time Functions ......................................................................................

      • Using the Time Functions ............................................................................

      • Error-Handling ....................................................................................................

        • Theassert()Macro ....................................................................................

        • Theerrno.hHeader File ..............................................................................

        • Theperror()Function ................................................................................



      • Searching and Sorting ........................................................................................

        • Searching with bsearch()............................................................................

        • Sorting with qsort()....................................................................................

        • Searching and Sorting: Two Demonstrations ................................................



      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................







  • TYPE& RUN 6 Calculating Mortgage Payments

    • DAY 20 Working with Memory

      • Type Conversions ................................................................................................

        • Automatic Type Conversions ........................................................................

        • Explicit Conversions Using Typecasts ..........................................................



      • Allocating Memory Storage Space ....................................................................

        • Allocating Memory with the malloc()Function ..........................................

        • Allocating Memory with the calloc()Function ..........................................

        • Allocating More Memory with the realloc()Function ..............................

        • Releasing Memory with the free()Function ..............................................



      • Manipulating Memory Blocks ............................................................................

        • Initializing Memory with the memset()Function ........................................

        • Copying Memory with the memcpy()Function ............................................

        • Moving Memory with the memmove()Function ............................................



      • Working with Bits ..............................................................................................

        • The Shift Operators ......................................................................................

        • The Bitwise Logical Operators ....................................................................

        • The Complement Operator ............................................................................

        • Bit Fields in Structures ..................................................................................



      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................





    • DAY 21 Advanced Compiler Use

      • Programming with Multiple Source-Code Files ................................................

        • Advantages of Modular Programming ..........................................................

        • Modular Programming Techniques ..............................................................

        • Module Components ....................................................................................

        • External Variables and Modular Programming ............................................

        • Using .obj Files ............................................................................................

        • Using the Make Utility ..................................................................................



      • The C Preprocessor ............................................................................................

        • The#definePreprocessor Directive ............................................................

        • Using the #includeDirective ........................................................................

        • Using#if,#elif,#else, and#endif............................................................

        • Using#if...#endifto Help Debug ............................................................

        • Avoiding Multiple Inclusions of Header Files ..............................................

        • The#undefDirective ....................................................................................



      • Predefined Macros ..............................................................................................

      • Using Command-Line Arguments ......................................................................

      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................







  • WEEK3 INREVIEW

  • BONUSWEEKATAGLANCE

    • Where You’re Going ..........................................................................................

    • BONUSDAY 1 Object-Oriented Programming Languages

      • Procedural and Object-Oriented Languages ......................................................

      • The Object-Oriented Constructs ........................................................................

        • Adapting with Polymorphism ......................................................................

        • Encapsulating It All ......................................................................................

        • Pulling from the Past with Inheritance ..........................................................

        • OOP in Action ..............................................................................................

        • The Relationship of C++ to C ......................................................................

        • C++ Programs ..............................................................................................



      • The Java Programming Language ......................................................................

        • The Relationship of Java to C and C++ ........................................................

        • Java’s Platform Independence ......................................................................

        • Packages ........................................................................................................

        • Java Applets Versus Applications ..................................................................

        • Java’s Class Libraries ....................................................................................

        • Saying Hello, World with Java ......................................................................



      • The C# Programming Language ........................................................................

      • Summary ............................................................................................................

      • Q&A ....................................................................................................................



    • Workshop ............................................................................................................

      • Quiz ..............................................................................................................

      • Exercises ........................................................................................................





  • BONUSDAY 2 The C++ Programming Language

    • Hello C++ World! ..............................................................................................

      • Printing in C++ ..............................................................................................



    • Understanding the C++ Keywords ....................................................................

    • The C++ Data Types ..........................................................................................

    • Declaring Variables in C++ ................................................................................

    • Doing Operations in C++ ..................................................................................

    • Working with Functions in C++ ........................................................................

      • Overloading Functions ..................................................................................

      • Creating Default Function Parameter Values ................................................

      • Inline Functions ............................................................................................



    • Summary ............................................................................................................

    • Q&A ....................................................................................................................

    • Workshop ............................................................................................................

      • Quiz ..............................................................................................................

      • Exercises ........................................................................................................





  • BONUSDAY 3 Working with C++ Classes and Objects

    • Working with Complex Data in C++ ................................................................

      • Using Functions with Structures ..................................................................



    • Using Classes ......................................................................................................

      • Controlling Access to Data in a Class ..........................................................

      • Setting the Access Type on Class Data ........................................................



    • Creating Access Member Functions ..................................................................

    • Structures Versus Classes ....................................................................................

    • Housekeeping with Classes ................................................................................

    • Starting with Constructors ..................................................................................

      • Ending with Destructors ................................................................................

      • Using Constructors and Destructors ..............................................................



    • Function Overloading Revisited ........................................................................

    • Review of the OOP Constructs in C++ ..............................................................

    • Using Classes as Data Members ........................................................................

      • Accessing Classes in Classes ........................................................................



    • Inheriting in C++ ................................................................................................

      • Building a Base Class for Inheritance ..........................................................

      • The Protected Access Data Modifier ............................................................

      • Inheriting from a Base Class ........................................................................

      • Constructors and Destructors Revisited ........................................................

      • A Caution on What You’ve Learned About C++ ................................................

        • Where to Go to Learn More ..........................................................................



      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercises ........................................................................................................





    • BONUS DAY 4 Java Language Fundamentals

      • Structure of a Java Program ................................................................................

      • Java Program Essentials ......................................................................................

        • Working with Imports ..................................................................................

        • Methods ........................................................................................................

        • Comments ......................................................................................................



      • Java Keywords ....................................................................................................

      • Java Identifiers ....................................................................................................

      • Data Types ..........................................................................................................

        • The Primitive Data Types ..............................................................................

        • Constants ......................................................................................................

        • Declaring and Initializing Variables ..............................................................

        • Variable Scope ..............................................................................................

        • Storing String Data ........................................................................................



      • Input and Output ................................................................................................

      • Arrays ..................................................................................................................

      • Operators ............................................................................................................

      • Flow Control ......................................................................................................

        • if...else......................................................................................................

        • whileanddo...while..................................................................................

        • switch............................................................................................................

        • for................................................................................................................



      • Summary ............................................................................................................

      • Q&A ....................................................................................................................

      • Workshop ............................................................................................................

        • Quiz ..............................................................................................................

        • Exercise ........................................................................................................







  • BONUSDAY 5 Working with Java Classes and Methods

    • Defining a Class ..................................................................................................

      • Specifying the Class Package ........................................................................

      • Creating Class Properties ..............................................................................

      • A Simple Demonstration ..............................................................................



    • Class Methods ....................................................................................................

      • A Method Demonstration ..............................................................................

      • Overloading Methods ....................................................................................

      • Class Constructors ........................................................................................



    • Using Inheritance ................................................................................................

    • Summary ............................................................................................................

    • Q&A ....................................................................................................................

    • Workshop ............................................................................................................

      • Quiz ..............................................................................................................





  • BONUSDAY 6 More Java Techniques

    • Working with Java Exceptions ..........................................................................

    • Reading and Writing Files ..................................................................................

      • Reading Text Files ........................................................................................

      • Writing Text Files ..........................................................................................



    • Doing Graphics and Windows ............................................................................

      • Creating Windowing Applications ................................................................

      • Drawing Shapes and Lines ............................................................................

      • Using Buttons and Pop-Up Windows ..........................................................



    • Programming Java Applets ................................................................................

      • Differences Between Applets and Applications ............................................

      • Understanding the Structure of an Applet ....................................................

      • Putting an Applet on a Web Page ..................................................................

      • Using an Applet ............................................................................................



    • Summary ............................................................................................................

    • Q&A ....................................................................................................................

    • Workshop ............................................................................................................

      • Quiz ..............................................................................................................





  • BONUSDAY 7 The C# Programming Language

    • What Is C#? ........................................................................................................

    • Why C#? ............................................................................................................

      • C# Is Simple ..................................................................................................

      • C# Is Modern ................................................................................................

      • C# Is Object-Oriented ..................................................................................

      • C# Is Powerful and Flexible ........................................................................

      • C# Is a Language of Few Words ..................................................................

      • C# Is Modular ................................................................................................

      • C# Will Be Popular ......................................................................................



    • C# Versus Other Programming Languages ........................................................

    • Types of C# Programs ........................................................................................



Free download pdf