Computing with C# and the.NET Framework Chapter 1 An Introduction to Computing with C# ©2003, 2011 Art Gittleman.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

Chapter 1: Introduction
COSC 120 Computer Programming
PLLab, NTHU Cs2403 Programming Languages Implementation Issues Cs2403 Programming Language Spring 2005 Kun-Yuan Hsieh.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
Revealing the CLR 4.0 Internals Svetlin Nakov Telerik Corporation
Introduction to the C# Programming Language for the VB Programmer.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Data Structure and Algorithm 1 Yingcai Xiao. You Me The Course (
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
Introduction to Computing and Programming
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
An Overview of Computers and Programming
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
CH1 – A 1 st Program Using C#. Program Set of instructions which tell a computer what to do. Machine Language Basic language computers use to control.
Your Interactive Guide to the Digital World Discovering Computers 2012.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Introduction 01_intro.ppt
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
A First Program Using C#
High-Level Programming Languages: C++
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Module 1: Introduction to C# Module 2: Variables and Data Types
Microsoft Visual Basic 2005: Reloaded Second Edition
Appendix D: Microsoft.NET Framework Overview. Overview.NET Framework Architecture.NET Namespaces.
Introduction to .NET Framework
1Object-Oriented Program Development Using C++ Computer Science and Programming Languages Computers are ubiquitous Computer literacy is essential Computer.
INTRODUCTION TO COMPUTING CHAPTER NO. 06. Compilers and Language Translation Introduction The Compilation Process Phase 1 – Lexical Analysis Phase 2 –
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
ISYS 573 Special Topic – VB.Net David Chao. The History of VB Early 1960s:BASIC-Beginner’s All-Purpose Symbolic Instruction Code –Teaching –Simple syntax,
Chapter 1 Introduction. Goal to learn about computers and programming to compile and run your first Java program to recognize compile-time and run-time.
UNIT - 1Topic - 3. Computer software is a program that tells a computer what to do. Computer software, or just software, is any set of machine-readable.
Programming in C#. I. Introduction C# (or C-Sharp) is a programming language. C# is used to write software that runs on the.NET Framework. Although C#
Week 1: THE C# LANGUAGE Chapter 1: Variables and Expressions ➤ Included in Visual Studio.NET ➤ What the.NET Framework is and what it contains ➤ How.NET.
Chapter 1 Introduction to Computers and C++ Programming Goals: To introduce the fundamental hardware and software components of a computer system To introduce.
Chapter 1 Section 1.1 Introduction to Java Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
Introduction to VB.Net. What is.NET? A brand of Microsoft technologies A platform for creating distributed Web applications A combination of new and updated.
Languages and IDE (Integrated Development Environment)
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Compilers: Overview/1 1 Compiler Structures Objective – –what are the main features (structures) in a compiler? , Semester 1,
Programming Logic and Design Seventh Edition
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Introduction to C++.  Computers: CPU, Memory & Input / Output (IO)  Program: Sequence of instructions for the computer.  Operating system: Program.
Introduction to C# Programming with Microsoft.NET AY
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
Chapter 1: Introduction to Computers and Programming.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 1 An Introduction to Visual Basic.NET and Program Design.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Software Engineering Algorithms, Compilers, & Lifecycle.
IS 350 Course Introduction. Slide 2 Objectives Identify the steps performed in the software development life cycle Describe selected tools used to design.
Introduction to .NET Framework
Introduction to Visual Basic 2008 Programming
C# and the .NET Framework
Java programming lecture one
Introduction to C# AKEEL AHMED.
C# Programming: From Problem Analysis to Program Design
Mobile Development Workshop
Compiler Structures 1. Overview Objective
IS 135 Business Programming
Presentation transcript:

Computing with C# and the.NET Framework Chapter 1 An Introduction to Computing with C# ©2003, 2011 Art Gittleman

Storage Processor Input Output Figure 1.1 A computer system Memory

Introduction to Computing Processors have different instruction sets with low-level simple instructions High-level languages – more expressive, closer to software design Compilers translate from one language to another Interpreters execute code

Figure 1.1 Translating a high-level program High-level program Processor ABC program (executable) Compiler

The.NET Framework Two main parts Common Language Runtime (CLR) manages execution of code and provides services.NET Framework Class Library provides a large and very useful set of types

The Common Language Runtime Common Type System defines the types of data that manages code can use. Common Language Specification (CLS) defines features that every language for developing managed code must provide Each language code compiles to MSIL, Microsoft Intermediate Language. Compiles to native code at runtime.

The.NET Framework Class Library Groups types into namespaces. Contains about 100 namespaces. For example, System -- Contains fundamental types. System.Drawing -- Provides graphics. System.Windows.Forms -- For user interfaces in Windows-based applications

C# Features Object-oriented – used for business objects or system applications – internet applications Goals include productivity and safety power, expressiveness, and flexibility Combines rapid application development of Visual Basic with power of C++

How C# works Compiler translates C# source to MSIL code for a virtual machine, similar to a hardware processor During runtime the CLR use a Just-In-Time (JIT) compiler to translate the MSIL code to the instruction set of the processor

Figure 1.2 Compiling and executing a Java program C#Source Code MSIL code Compiler JIT1 JIT2 Processor 1 code Processor 2 code

public class Square { static void Main() { int number = 345; // '=' denotes assignment int squared = number * number; // '*' denotes multiplication System.Console.WriteLine ("The square of {0} is {1}", number, squared); } Example 1.1

The output of Example 1.1 The square of 345 is System namespace, Console class, WriteLine method "The square of {0} is {1}" is a pattern The value of number substitutes for {0} The value of squared substitutes for {1}

Lexical Structure Rules for dividing program text into a sequence of elements Whitespace -- spaces, tabs, carriage returns Comment – for human readers only Punctuators ( ) { } [ ] ;,. : Operators + - * / and so on Literals – specific values such as 345 Identifiers – the names used for program entities Keywords – reserved names for special uses

int number = 345; keyword identifier operator literal punctuator (int) (number) (=) (345) (;) (whitespace and comment discarded) Figure 1.7 Lexical analysis of a single line of Example 1.1 C# compiler lexical analyzer

Syntax Grammatical rules for combining lexical elements into programs Declaration – defines a part of a program Statements – controls execution sequence Expressions – compute values

class declaration method declaration statement Figure 1.8 The overall syntactic structure of Example 1.1

The Steps of Software Development Identifying the requirements of the system. Designing a system that meets the requirements. Implementing the system. Testing that the system operates correctly and meets the requirements. Making improvements as needed.