Intro to Computer Programming

Views:
 
Category: Education
     
 

Presentation Description

This is an intro to computer programming. Created by Fraser King.

Comments

By: supeksha (37 month(s) ago)

Its very useful to me......Thnx............

By: farismohideen (43 month(s) ago)

Intro to Computer Programming I need this presentation for my studies pls help

Presentation Transcript

Computer programming : 

Computer programming An intro to...

// Overview : 

// Overview This presentation has been created in hopes of teaching people the basics of computer programming. It contains: - What can programming do for us? - The basics - Hello World - Advanced code - Conclusion

// this presentation is brought to you by : 

// this presentation is brought to you by The Community Access Program Industry Canada The Huron County Library system

// what exactly is computer programming? : 

// what exactly is computer programming? By definition: Computer programming (often shortened to programming or coding) is the process of writing, testing, debugging/troubleshooting, and maintaining the source code of computer programs. These computer programs could range from facial recognition programs used by law enforcement officers to the video games we play without even wondering. It’s simply amazing how dependent we are on computers and what they can do!

// computer programming : 

// computer programming Facebook eMail cell phones GPS Television All of these things have been accomplished because of programming! Let’s take a look at some of the amazing things you could accomplish if you stuck with programming.

// computer programming : 

// computer programming seaDragon/Photosynth – Microsoft Corporation

// computer programming : 

// computer programming There are hundreds of different types of programming languages. But each one has special properties that makes it unique. For the purpose of this slide-show, we are going to be looking at the language of C#, due to the similarities it has with multiple other languages. And the easy to read syntax.

// the basics : 

// the basics Let’s see how a simple line of code is transformed into something the computer can read and execute. This is done through the compiler. That’s our code -> <- We hit build Transformed once -> (still not readable by the computer)‏ Transformed again ^ <- is now compatible with the computer WHAT!?! WHAT!?! WHAT!?! WHAT!?! WHAT!?!

// the basics : 

// the basics Without ending up like this: I’ll try and explain 

// the basics : 

// the basics So to get compilers out of the way… Compilers compile program source code into runnable programs (or "binaries"). Some programming languages, such as C# have to be compiled before they will run on most computers. Compilation means reading the source code - which, while not English by any stretch, is comparatively easy for humans to read - and translating it into raw machine code - zeroes and ones that the computer's specific CPU chip can understand and run quickly. Now that we have the basics of how our ‘code’ is transformed into something the computer reads, let’s take our first look at some C#!

// C# : 

// C# The C# programming language revolves around it being object oriented. This means it uses a system of classes and objects. Also, methods, constants, constructors, properties, indexers, and operators decide how the program ticks. It may sound like a lot but we’ll move through the next part slowly. Again, if you have any questions, feel free to ask at any time.

// C# : 

// C# using System; class HelloCsharp { public static void Main()‏ { Console.WriteLine("Hello CSharp World!"); } } This is one of the first things I learned in C#. It’s a simple script that will have an output of the text in red. Hello CSharp World! Input simply means what you sending in to the computer, and the output is what is being displayed via the monitor in this case. Input: Output:

// C# : 

// C# using System; public class HelloCsharp { public static void Main()‏ { Console.WriteLine("Hello CSharp World!"); } } So let’s start at the top with: using System; With the using command, we tell the program to include this namespace (which is whatever is following it). In this case it is the System namespace which contains fundamental classes and base classes that define commonly-used value and reference data types, events and event handlers, interfaces, attributes, and processing exceptions. In other words, the namespace contains information to help make your code easier for you to write.

// C# : 

// C# using System; public class HelloCsharp { public static void Main()‏ { Console.WriteLine("Hello CSharp World!"); } } The next line is: public class HelloCsharp The hardest part of C# programming is grasping the concept of a class. This is the best definition of classes and object oriented programming I could find. In the object-oriented approach, a class is used to define an abstract data type, and the operations of the type are referred to as methods. These classes each contain a specific set of instructions and because they are all separate it is very easy to distinguish information between them. HelloCsharp is the name we gave it.

// C# : 

// C# You may have noticed the { and } brackets. using System; public class HelloCsharp { public static void Main()‏ { Console.WriteLine("Hello CSharp World!"); } } These are used to separate classes, methods and functions. Whatever is contained in these brackets is code associated with the class, method or function. Public static void Main()‏ Sounds like a mouthful, but in reality we are past the most difficult stuff and is really just a bunch of commands put together. Public means that it can be viewed or used anywhere in your project. Static means that it is unchanging. Void means it is not returning any values. and Main() is the name of the method. It can be anything we want.

// C# : 

// C# using System; public class HelloCsharp { public static void Main()‏ { Console.WriteLine("Hello CSharp World!"); } } The las part is: Console.WriteLine(“text”); These commands are being imported from inside System (which we included at the top). If your wondering what the commands mean; Console is basically your computer and WriteLine is exactly what it sounds like-please write whatever is inside these brackets. If we had decided not to use System, that line would look like: System.Console.WriteLine... Etc (So you could look at what we did as a shortcut)

// C# : 

// C# That was a very basic example with what can be accomplished with the C# language. In the end it would look like this:

// advanced : 

// advanced Eventually if you stick with it you can create: Dynamic video games: Interactive programs: Day-day devices: Even degrees of Artificial Intelligence! The possibilities are endless!

// conclusion : 

// conclusion I only showed you one style of programming language today. But there are MANY more. Luckily, after learning one of this magnitude, you will see extreme similarities between other languages, making them that much easier to master as well. If you are interested in starting out in programming after this session I would suggest another language to begin on.

// conclusion : 

// conclusion VisualBasic Due to it’s easier to grasp concepts and the simple syntax it contains, I feel this would be a much better choice for a beginner programmer. For more information about Web Page Development or to book an appointment with me, please visit: Frasertheking.com

// conclusion : 

// conclusion Any questions? ? ? ? ? ?