C# 7.0 All-in-One For Dummies
eBook - ePub

C# 7.0 All-in-One For Dummies

John Paul Mueller, Bill Sempf, Chuck Sphar

Share book
  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

C# 7.0 All-in-One For Dummies

John Paul Mueller, Bill Sempf, Chuck Sphar

Book details
Book preview
Table of contents
Citations

About This Book

Sharpen your knowledge of C#

C# know-how is a must if you want to be a professional Microsoft developer. It's also good to know a little C# if you're building tools for the web, mobile apps, or other development tasks. C# 7.0 All-in-One For Dummies offers a deep dive into C# for coders still learning the nuances of the valuable programming language. Pop it open to get an intro into coding with C#, how to design secure apps and databases, and even pointers on building web and mobile apps with C#.

C# remains one of the most in-demand programming language skills. The language regularly ranks in the top five among "most in-demand" languages, typically along with Java/JavaScript, C++, and Python. A December 2016 ZDNet article noted 'If your employer is a Microsoft developer, you better know C#." Lucky for you, this approachable, all-in-one guide is here to help you do just that—without ever breaking a sweat!

Includes coverage of the latest changes to C#

  • Shows you exactly what the language can (and can't) do
  • Presents familiar tasks that you can accomplish with C#
  • Provides insight into developing applications that provide protection against hackers

If you have a basic understanding of coding and need to learn C#—or need a reference on the language in order to launch or further your career—look no further.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is C# 7.0 All-in-One For Dummies an online PDF/ePUB?
Yes, you can access C# 7.0 All-in-One For Dummies by John Paul Mueller, Bill Sempf, Chuck Sphar in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in C#. We have over one million books available in our catalogue for you to explore.

Information

Publisher
For Dummies
Year
2017
ISBN
9781119428107
Edition
1
Book 1

The Basics of C# Programming

Contents at a Glance
  1. Chapter 1: Creating Your First C# Console Application
    1. Getting a Handle on Computer Languages, C#, and .NET
    2. Creating Your First Console Application
    3. Making Your Console App Do Something
    4. Reviewing Your Console Application
    5. Introducing the Toolbox Trick
  2. Chapter 2: Living with Variability — Declaring Value-Type Variables
    1. Declaring a Variable
    2. What’s an int?
    3. Representing Fractions
    4. Handling Floating-Point Variables
    5. Using the Decimal Type: Is It an Integer or a Float?
    6. Examining the bool Type: Is It Logical?
    7. Checking Out Character Types
    8. What’s a Value Type?
    9. Comparing string and char
    10. Calculating Leap Years: DateTime
    11. Declaring Numeric Constants
    12. Changing Types: The Cast
    13. Letting the C# Compiler Infer Data Types
  3. Chapter 3: Pulling Strings
    1. The Union Is Indivisible, and So Are Strings
    2. Performing Common Operations on a String
    3. Comparing Strings
    4. What If I Want to Switch Case?
    5. Looping through a String
    6. Searching Strings
    7. Getting Input from the Command Line
    8. Controlling Output Manually
    9. Formatting Your Strings Precisely
    10. StringBuilder: Manipulating Strings More Efficiently
  4. Chapter 4: Smooth Operators
    1. Performing Arithmetic
    2. Performing Logical Comparisons — Is That Logical?
    3. Matching Expression Types at TrackDownAMate.com
  5. Chapter 5: Getting into the Program Flow
    1. Branching Out with if and switch
    2. Here We Go Loop-the-Loop
    3. Looping a Specified Number of Times with for
    4. Nesting Loops
    5. Don’t goto Pieces
  6. Chapter 6: Lining Up Your Ducks with Collections
    1. The C# Array
    2. Processing Arrays by Using foreach
    3. Sorting Arrays of Data
    4. Using var for Arrays
    5. Loosening Up with C# Collections
    6. Understanding Collection Syntax
    7. Using Lists
    8. Using Dictionaries
    9. Array and Collection Initializers
    10. Using Sets
    11. On Not Using Old-Fashioned Collections
  7. Chapter 7: Stepping through Collections
    1. Iterating through a Directory of Files
    2. Iterating foreach Collections: Iterators
    3. Accessing Collections the Array Way: Indexers
    4. Looping Around the Iterator Block
  8. Chapter 8: Buying Generic
    1. Writing a New Prescription: Generics
    2. Classy Generics: Writing Your Own
    3. Revising Generics
  9. Chapter 9: Some Exceptional Exceptions
    1. Using an Exceptional Error-Reporting Mechanism
    2. Throwing Exceptions Yourself
    3. Knowing What Exceptions Are For
    4. Can I Get an Exceptional Example?
    5. Assigning Multiple catch Blocks
    6. Planning Your Exception-Handling Strategy
    7. Grabbing Your Last Chance to Catch an Exception
    8. Throwing Expressions
  10. Chapter 10: Creating Lists of Items with Enumerations
    1. Seeing Enumerations in the Real World
    2. Working with Enumerations
    3. Creating Enumerated Flags
    4. Defining Enumerated Switches
Chapter 1

Creating Your First C# Console Application

IN THIS CHAPTER
check
Getting a quick introduction to programming
check
Creating a simple console application
check
Examining the console application
check
Saving code for later
This chapter explains a little bit about computers, computer languages — including the computer language C# (pronounced “see sharp”) — and Visual Studio 2017. You then create a simple program written in C#.

Getting a Handle on Computer Languages, C#, and .NET

A computer is an amazingly fast but incredibly stupid servant. Computers will do anything you ask them to (within reason); they do it extremely fast — and they’re getting faster all the time.
Unfortunately, computers don’t understand anything that resembles a human language. Oh, you may come back at me and say something like, “Hey, my telephone lets me dial my friend by just speaking his name.” Yes, a tiny computer runs your telephone. So that computer speaks English. But that’s a computer program that understands English, not the computer itself.
The language that computers truly understand is machine language. It’s possible, but extremely difficult and error prone, for hum...

Table of contents