Lec6 - Lecture 6: Introduction to C# - Console Applications...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Lecture 6: Introduction to C# -- Console Applications PIC 10C Todd Wittman What is C#? b C# (pronounced "C sharp") is a programming language that uses the Microsoft .NET libraries to develop applications. b It will allow us to incorporate a graphical user interface (GUI) into our programs. b C# is a cross between C++ and Java. b Topics Covered Today: s How to build a C# console application s Basic Program Structure s Basic Types: numbers, strings, arrays s Console Input / Output s Simple Functions
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Build a C# Console Application b File b New Project b Other Languages b Visual C# b Console Application b OK This creates a default source file Program.cs Obvious Differences with C++ 1. C# likes to use capital letters on reserved words, e.g. Main() 2. Input/Output is different. Instead of cin/cout we use: Console.Read() and Console.Write() 3. EVERYTHING IS A CLASS! s Console is a class with member functions Read() and Write() . s int , double , and array are classes. s Your program is a class called Program and Main() is one of its member functions.
Background image of page 2
3 Your First C# Program using System; class Program { static void Main( ) { Console.Write("Aye Carumba!\n\n"); } } •We include a namespace with the reserved word using . •System is a standard namespace with over a hundred useful libraries like Console , Math , String , Array . •Every program we write uses
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/18/2010 for the course PIC 10C taught by Professor Wittman during the Spring '10 term at UCLA.

Page1 / 9

Lec6 - Lecture 6: Introduction to C# - Console Applications...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online