Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to C# Programming Version 1.1. Objectives  Help you learn to read and follow instructions  Look at how and why we write programs  Describe.

Similar presentations


Presentation on theme: "Introduction to C# Programming Version 1.1. Objectives  Help you learn to read and follow instructions  Look at how and why we write programs  Describe."— Presentation transcript:

1 Introduction to C# Programming Version 1.1

2 Objectives  Help you learn to read and follow instructions  Look at how and why we write programs  Describe some things it takes to learn to be a programmer  Discuss some important programming tools  Investigate how the computer works as it executes a program  Describe the steps involved in creating and running a program

3 Course Materials Schedule Syllabus Slides Example Programs etc. ftp://cseftp.tc.uvu.edu cns/fairclde/Spring 2011/CS1400 cns/fairclde/Spring 2011/CS1400

4 C# is programming language Programming languages allow us to communicate with the computer. Just as English is a verbal/written language to allow us to communicate with other people. We can’t speak with computers, we can only write to them. This written language is called a PROGRAM! C# programs are written in text then compiled (translated) from text to binary machine language that the computer understands.

5 Visual C# 2010 Express Visual C# 2010 is a programming environment –Sophisticated Text Editor –Compiler –Lots of neat tools to help us!

6 Basic C# Program static class Program { static void main( ) { System.Console.WriteLine("Hello, world"); System.Console.Write("Press any key to continue..."); System.Console.ReadLine(); }

7 Improved Basic C# Program using System; static class Program { static void main( ) { Console.WriteLine("Hello, world"); Console.Write("Press any key to continue..."); Console.ReadLine(); }

8 Compile and Run It! Press F5 Button or Green “Shazam” Button

9 Lab01 See how it works, see how Jack runs!

10 Now Zip it and Email it! Go to the project folder. –Documents, Visual Studio 2010, Projects Right click on lab01. –Send To, Compressed (Zipped) Folder. –lab01.zip –Rename to lab01dafv1.0.zipd Attach to email and Email to 1400dennis@gmail.com1400dennis@gmail.com –Subject: CS1400 lab01dafv1.0

11 Why would you want to learn to program? The sheer joy of making things – being creative The pride in making something that is useful to other people The fascination of solving complex problems Figuring out how to do something you’ve never done before Making a dumb machine do smart things Earning a lot of money This class is required …

12 Comment from a student … “I want a career, not just a degree”

13

14 This is about $80k/yr

15 Robotics

16 Games

17 Computer Graphics/Animation

18 Science/Math

19 Entertainment/Communication

20 Web Applications

21 Business/Finance

22 Engineering

23 Learning to program requires Time Patience Good language skills The ability to think abstractly Good math skills The ability to solve problems Practice – Program, program, program A sense of curiosity

24 Learning to Program Takes Time Researchers have shown that learning to do anything well (playing the piano, painting, playing tennis, etc) takes about 10 years. Learning to be a good programmer is no different. To become proficient at programming Practice Practice …

25 The rise of mathematics is heating up the job market for luminary quant's, especially at the Internet powerhouses where new math grads land six-figure salaries and rich stock deals. Tom Leighton, an entrepreneur and applied math professor at Massachusetts Institute of Technology, says: "All of my students have standing offers at Yahoo! and Google. Top mathematicians are becoming a new global elite. It's a force of barely 5,000, by some guesstimates, but every bit as powerful as the armies of Harvard University MBAs who shook up corner suites a generation ago. Math Skills are Important Business Week Cover Story January 23, 2006

26

27 What do Programmers Do? They talk to their customers They talk to their peers They discuss problems They think a lot They write a lot They design solutions to problems They write code They debug code They refactor code They test code They document code They fix code...

28

29

30 Google Offices

31 Programming Tools The computer The operating system The code editor The compiler The debugger Integrated Development Environment (IDE) Problem solving skills Language skills

32 The Computer Data Segment Code Segment Stack Heap Memory Program Counter Instruction Register General Purpose Registers Status Registers Arithmetic and Logic Unit CPU

33 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register General Purpose Register Status Registers Arithmetic and Logic Unit

34 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register General Purpose Register Status Registers Arithmetic and Logic Unit Watch how the computer adds two numbers together …

35 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 60 address The program to be executed is stored in the code segment. The data is stored in the data segment. The program counter points to the next instruction to be executed.

36 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 60 address

37 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 60 address ld r1, 24

38 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 60 address 10 ld r1, 24

39 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 64 address 10 ld r1, 24 10

40 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 64 address 10 ld r1, 24 10 ld r2, 28

41 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 64 address 10 ld r2, 28 10 12

42 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 68 address 10 ld r2, 28 10 12

43 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 68 address 10 ld r2, 28 10 12 add r1, r2

44 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 68 address 10 add r1, r2 10 12 10 12 22

45 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 68 address 10 add r1, r2 10 12 22

46 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 -- 24 28 32 60 64 68 72 address 10 ld r1, 24 22 12 sto r1, 32

47 The Computer Data Segment Code Segment Stack Heap Program Counter Instruction Register Register r1 Arithmetic and Logic Unit ld r1, 24 ld r2, 28 add r1, r2 sto r1, 32 Register r2 10 12 24 28 32 60 64 68 72 address 10 sto r1, 32 22 12 22

48 The Operating System Manages the memory in the computer Manages how and when programs are executed Manages the devices attached to the computer and lots of other stuff …

49 The code editor provides a way for The programmer to create and edit the source code text for his or her program. Editors provide tools to cut and paste source Code text, move between source code files, and do many other editing tasks.

50

51 static void Main( ) { int a = 5; int b = 27;... source code compiler The Compiler

52        Intermediate Language source code compiler

53        Intermediate Language Interpreter compiler source code code segment data segment stack segment.exe

54 reserved for operating system program A program B the heap the heap is left over memory, not being used by any program. It is managed by the O/S. code segment data segment stack segment loader program C

55 Visual C# Express Edition is an Integrated Development Environment (IDE). It includes * a code editor * a compiler * a debugger * and other development tools

56 If you have not completed lab #1, be sure to complete it and turn it in per the course schedule.

57 Questions?


Download ppt "Introduction to C# Programming Version 1.1. Objectives  Help you learn to read and follow instructions  Look at how and why we write programs  Describe."

Similar presentations


Ads by Google