C# for the Approved Workman
()
About this ebook
Drawing from many years of professional software development and teaching experience, I prepared an innovative text that presents the C# language in a simple, yet powerful way, at the same time integrating Biblical perspective.
Few textbooks address the simplicity of C#, many are unable to address the complexity of real-world systems, and few if any have attempted to integrate faith with content to prepare students and new programmers for the workplace. This textbook has three goals. The first is to arm the Christian student with Scripture compatible with business-oriented programming, that they may be able witnesses for Christ. The second is to present C# in all its simplicity, that it may be a joy to use. The third is to present a realistic prototype system so students can be prepared for good works in their business endeavors. Software applications illustrating major concepts in each chapter are available electronically via a link in the text. These can be used as is, or tailored to suit a variety of information processing applications.
Having started using BASIC in the late 1970s, then Visual Basic in the 1990s before Visual Studio existed, then Visual Studio first with C++ and now C# and VB, it has been my experience that computer languages are both similar and consistent in what they accomplish on all varieties of computer platforms. Visual Studio was used to test all code. Be sure to reference the latest C# language reference, along with product manuals for your specific version of Visual Studio, as you add to your knowledge where the text leaves off.
I have found it a great joy to develop this text under the influence and leading of the Holy Spirit of God, and count it a privilege to present it to you.
Also be sure to check out my latest inspirational book "Becoming an Approved Workman".
Wesley Sweetser, Jr
I have over 40 years experience in the private sector and government developing software and databases and managing projects and teaching. I "retired" in 2018 and continue working in Florida, glorifying God, doing home remodeling, publishing three programming eBooks in the Approved Workman series, along with finding work at a local college. God is good! May God bless you as you serve him.
Read more from Wesley Sweetser, Jr
Visual Basic for the Approved Workman Rating: 0 out of 5 stars0 ratingsCOBOL for the Approved Workman Rating: 0 out of 5 stars0 ratingsBecoming an Approved Workman Rating: 0 out of 5 stars0 ratingsSic Transit Gloria Mundi Rating: 0 out of 5 stars0 ratings
Related to C# for the Approved Workman
Related ebooks
Pro C# 9 with .NET 5: Foundational Principles and Practices in Programming Rating: 0 out of 5 stars0 ratingsLearning .NET High-performance Programming Rating: 0 out of 5 stars0 ratingsC# Programming & Software Development: 6 In 1 Coding Syntax, Expressions, Interfaces, Generics And App Debugging Rating: 0 out of 5 stars0 ratingsC# Programming Fundamentals Rating: 0 out of 5 stars0 ratingsPython for Developers Rating: 0 out of 5 stars0 ratingsProgramming Concepts in C++ Rating: 0 out of 5 stars0 ratingsASP.NET 3.5 CMS Development Rating: 0 out of 5 stars0 ratingsC# Deconstructed: Discover how C# works on the .NET Framework Rating: 0 out of 5 stars0 ratingsImplementing C# 11 and .NET 7.0: Learn how to build cross-platform apps with .NET Core (English Edition) Rating: 0 out of 5 stars0 ratingsASP.NET and VB.NET in 30 Days: Acquire a Solid Foundation in the Fundamentals of Windows and Web Application Development Rating: 0 out of 5 stars0 ratingsASP.NET Core for Jobseekers: Build Career in Designing Cross-Platform Web Applications Using Razor and Entity Framework Core Rating: 0 out of 5 stars0 ratingsC# For Beginners: An Introduction to C# Programming with Tutorials and Hands-On Examples Rating: 0 out of 5 stars0 ratingsC Programming Language The Beginner’s Guide Rating: 0 out of 5 stars0 ratingsSoftware Development Accelerated Essentials: What You Didn't Know, You Needed to Know Rating: 0 out of 5 stars0 ratingsAdvanced C++ Interview Questions You'll Most Likely Be Asked Rating: 0 out of 5 stars0 ratingsMicrosoft .NET Framework 4.5 Quickstart Cookbook Rating: 0 out of 5 stars0 ratingsMastering C# 8.0: Master C# Skills with Hands-on Code Examples (English Edition) Rating: 0 out of 5 stars0 ratingsHow to Find and Land a Microsoft .NET Development Job Rating: 0 out of 5 stars0 ratingsThinking In C# Programming. Rating: 0 out of 5 stars0 ratingsLearn WPF MVVM - XAML, C# and the MVVM pattern Rating: 4 out of 5 stars4/5Simultaneous multithreading A Complete Guide Rating: 0 out of 5 stars0 ratingsAngularJS Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsMVVM Survival Guide for Enterprise Architectures in Silverlight and WPF Rating: 0 out of 5 stars0 ratingsWindows Presentation Foundation 4.5 Cookbook Rating: 0 out of 5 stars0 ratingsC# Programming from Zero to Proficiency (Beginner): C# from Zero to Proficiency, #2 Rating: 0 out of 5 stars0 ratingsHello World: Student to Software Professional - a Transformation Guide Rating: 0 out of 5 stars0 ratingsA Quick Reference to Data Structures and Computer Algorithms: An Insight on the Beauty of Blockchain Rating: 0 out of 5 stars0 ratingsHands-On Network Programming with C# and .NET Core: Build robust network applications with C# and .NET Core Rating: 0 out of 5 stars0 ratings
Programming For You
Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5C++ Learn in 24 Hours Rating: 0 out of 5 stars0 ratingsGrokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5C# 7.0 All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsPython: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsLearn SQL in 24 Hours Rating: 5 out of 5 stars5/5Hacking: Ultimate Beginner's Guide for Computer Hacking in 2018 and Beyond: Hacking in 2018, #1 Rating: 4 out of 5 stars4/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Beginning Programming with Python For Dummies Rating: 3 out of 5 stars3/5C++ Programming Language Rating: 0 out of 5 stars0 ratingsPython: Learn Python in 24 Hours Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Game Development with Unreal Engine 5: Learn the Basics of Game Development in Unreal Engine 5 (English Edition) Rating: 0 out of 5 stars0 ratingsData Structures and Algorithm Analysis in Java, Third Edition Rating: 4 out of 5 stars4/5
Reviews for C# for the Approved Workman
0 ratings0 reviews
Book preview
C# for the Approved Workman - Wesley Sweetser, Jr
C# for
the Approved
Workman
by
Wesley D. Sweetser, Jr.
wesleysweetser@netscape.net
Companies, names and data used in examples in this text and the accompanying software are fictitious unless otherwise noted or Biblically true. No part of this book may be reprinted without written permission, except for brief quotations in books and critical reviews. The accompanying software may be used by the purchaser in software development enterprises as long as credit is given to its source. Permission to use Microsoft specific software is determined by the license granted by Microsoft for each user or site.
Unless otherwise indicated, Scripture is taken from the New American Standard Bible Copyright © 1960, 1963, 1968, 1971, 1972, 1973, 1975, 1977, 1988 by the Lockman Foundation. Used by permission.
Scripture (marked NIV) taken from the HOLY BIBLE, NEW INTERNATIONAL VERSION Copyright © 1973, 1978, 1984 International Bible Society. Used by permission of Zondervan Bible Publishers.
Visual Studio and SQL Server are registered trademarks of Microsoft Corporation in the United States of America and other countries.
Copyright © 2018 by Wesley D. Sweetser, Jr. All rights reserved.
Published electronically in the United States of America.
Ephesians 2:10
For we are His workmanship, created in Christ Jesus for good works, which God prepared beforehand, that we should walk in them.
2 Timothy 2:15
Be diligent to present yourself approved to God as a workman who does not need to be ashamed, handling accurately the word of truth.
Dedication
This work is dedicated to the Lord from Whom I have receive my strength and Who has granted me so great a salvation.
Romans 10:9-10
that if you confess with your mouth Jesus as Lord, and believe in your heart that God raised Him from the dead, you will be saved; for with the heart a person believes, resulting in righteousness, and with the mouth he confesses, resulting in salvation.
CONTENTS
Part 1 - Foundation
1. Introduction to C#
2. Methods
Part 2 - Tools
3. Interactive Programs
4. Database Input and Output
5. Arithmetic
6. Selection and Control
7. Arrays
Part 3 - Special Topics
8. Reports
9. SQL Server Integration
About the Author
PREFACE
Drawing from many years of professional software development and teaching experience, I prepared an innovative text that presents the C# language in a simple, yet powerful way, at the same time integrating Biblical perspective.
Few textbooks address the simplicity of C#, many are unable to address the complexity of real-world systems, and few if any have attempted to integrate faith with content to prepare students and new programmers for the workplace. This textbook has three goals. The first is to arm the Christian student with Scripture compatible with business-oriented programming, that they may be able witnesses for Christ. The second is to present C# in all its simplicity, that it may be a joy to use. The third is to present a realistic prototype system so students can be prepared for good works in their business endeavors.
An overview of C# and the primary Christian emphasis are presented in the first chapter. Then using object-oriented methodology, methods and loops are presented in chapter 2 with only a few commands needed to understand the sample code. Interactive programs are presented in chapter 3, with a menu and a complete suite of software available electronically which can be tailored for use in any system.
Chapter 4 introduces databases. Chapter 5 and 6 cover arithmetic, along with selection and control. Arrays are presented in chapter 7. Reports are covered in chapter 8 and the text concludes with an introduction to SQL Server Integration.
Code used in the text is available electronically at
https://drive.google.com/open?id=11PM8KVCUdjuTxr9hwq80Gdp5AQ8xmmo4
Mention of samples folders or .cs files or other files in the text refers to this link.
I have found it a great joy to develop this text under the influence and leading of the Holy Spirit of God, and count it a privilege to present it to you.
In Christ's service,
Wesley D. Sweetser, Jr.
October 2018
Part 1
Return to Contents
Foundation
1 Corinthians 3:10-11
According to the grace of God which was given to me, as a wise master builder I laid a foundation, and another is building upon it.
But let each man be careful how he builds upon it. For no man can lay a foundation other than the one which is laid, which is Jesus Christ.
CHAPTER ONE
Return to Contents
Introduction to C#
Isaiah 28:10
"For He says,
'Order on order, order on order,
Line on line, line on line,
A little here, a little there.' "
1.1 C# Overview
C# is a sophisticated language capable of creating and retrieving data on a massive scale with great flexibility and ease. C# is the mainstay of many businesses today.
C# is a language that helps bring order to business enterprises. Where there is disorder, we can use C# to create systems of programs to organize and rearrange data in meaningful ways. In a much more awesome manner, God created order from disorder and it was good:
Genesis 1:3-4
Then God said, Let there be light
; and
there was light. And God saw that the
light was good; and God separated the
light from the darkness.
Colossians 1:16
For by Him all things were created, both
in the heavens and on earth, visible and
invisible, whether thrones or dominions
or rulers or authorities -- all things
have been created by Him and for Him.
Throughout Scripture, we see how God has continued to order the world, particularly Israel in the Old Testament and the church in the New Testament. Each of the twelve tribes of Israel had a particular order in marching through the desert and in the setting up of the tabernacle, and there was order in constructing and rebuilding the Temple, to cite some Old Testament examples. With respect to the New Testament, the body of Christ is well ordered. It consists of many members, each with a particular function or purpose. We are admonished to do everything decently and in order
(1 Corinthians 14:40) with regard to congregational worship.
Bringing order out of chaos is not only prized within the business enterprise, but order is also highly valued within a C# program itself. If bringing order out of chaos was good to God, then writing a well-ordered C# program is a good work. To accomplish orderliness, we desire to have each component of our C# programs have a particular function or purpose, just as each member of the body of Christ has a particular purpose. We can accomplish this by making use of object-oriented programming concepts that are based on using classes, objects, and functions or methods to carry out specific tasks.
The advantage to a business of having highly structured or well-ordered programs and systems of programs built upon objects and methods, lies in the reduced cost to develop the software initially and to maintain these programs and systems as changes need to be made over time. Our desire is to honor and be like our God, who is a God of order, especially since we are His workmanship created in Him to perform good works (Eph. 2:10).
1.2 The Structure of C#
The structure of C# is somewhat precise. Here is a sample C# program showing the most basic structure:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hello
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Hello
);
// keep console open to see Hello message
// press any key or click X to close window
Console.ReadKey();
}
}
}
The first five lines are generated automatically when creating a new project as a Console Application using Visual Studio. The Console Application is the simplest type of program. In later chapters Web Applications will also be discussed.
The namespace is generated automatically and serves as a container for related classes and methods. This name also serves as the project folder name, solution name and project name (not including file