MODULE 1 CC123

Subdecks (2)

Cards (75)

  • Compiler
    A program that converts high-level language to assembly language
  • Assembler
    A program that converts assembly language to machine-level language
  • Program execution with C compiler
    1. User writes program in C language
    2. C compiler compiles program and translates to assembly program
    3. Assembler translates assembly program into machine code (object)
    4. Linker links all parts of program together for execution (executable machine code)
    5. Loader loads all into memory and executes program
  • Preprocessor
    A tool that produces input for compilers, deals with macro-processing, augmentation, file inclusion, language extension, etc.
  • Interpreter
    Translates high-level language into low-level machine language, reads and executes statements one by one, stops execution and reports errors
  • Linker
    Links and merges various object files together to make an executable file, locates referenced modules/routines and determines memory locations
  • Loader
    Part of operating system, responsible for loading executable files into memory and executing them, calculates program size and creates memory space, initializes registers
  • Cross-compiler
    A compiler that runs on platform (A) and generates executable code for platform (B)
  • Source-to-source compiler

    A compiler that translates source code of one programming language into source code of another programming language
  • Objects
    • Basic run-time entities in an object-oriented system, represent real-world entities, combine data and functions into a single unit
  • Class
    A new data type that contains member variables and member functions, objects are variables of the class type
  • Encapsulation
    Wrapping of data and functions together as a single unit, prevention of direct data access (data hiding)
  • Data Abstraction
    Representing essential features without including background details, classes are abstract data types (ADTs)
  • Inheritance
    Mechanism by which one class can inherit properties of another, allows building a hierarchy of classes from general to specific
  • Polymorphism
    Ability to take many forms, achieved through function overloading and operator overloading
  • Dynamic Binding

    Linking of a procedure call to the code to be executed is determined at run-time, associated with polymorphic references
  • Message Passing
    Objects communicate by sending messages, a message is a request for execution of a procedure in the receiving object
  • Differences between Procedure Oriented Programming (POP) and Object Oriented Programming (OOP)
    • POP divides program into functions, OOP divides program into objects
    • POP focuses on functions and sequence of actions, OOP focuses on data
    • POP follows top-down approach, OOP follows bottom-up approach
    • Data can move freely between functions in POP, objects communicate through member functions in OOP
    • POP lacks access specifiers, OOP has access specifiers like public, private, protected
    • Adding new data/functions is difficult in POP, easy in OOP
    • POP uses global data, OOP controls data access
    • Overloading not possible in POP, possible in OOP
  • Procedural Oriented Programming (POP)

    Program is divided into small parts called functions. Importance is not given to data but to functions as well as sequence of actions to be done.
  • Object Oriented Programming (OOP)
    Program is divided into parts called objects. Importance is given to the data rather than procedures or functions because it works as a real world. It follows Bottom Up approach.
  • POP
    Data can move freely from function to function in the system. It does not have any access specifier. To add new data and function is not so easy. Most function uses Global data for sharing that can be accessed freely from function to function in the system.
  • OOP
    Objects can move and communicate with each other through member functions. It has access specifiers named Public, Private, Protected, etc. OOP provides an easy way to add new data and function. In OOP, data cannot move easily from function to function, it can be kept public or private so we can control the access of data.
  • POP
    Overloading is not possible.
  • OOP
    Overloading is possible in the form of function overloading and operator overloading.
  • POP
    It doesn't have any proper way for hiding data so it is less secure.
  • OOP
    It provides data hiding so provides more security.
  • POP
    • C, FORTRAN, Pascal etc.
  • OOP
    • C++, JAVA, .NET etc.
  • C# is a modern, general-purpose, object-oriented programming language developed by Microsoft and approved by European Computer Manufacturers Association (ECMA) and International Standards Organization (ISO).
  • C# was developed by Anders Hejlsberg and his team during the development of .Net Framework.
  • C#
    Designed for Common Language Infrastructure (CLI), which consists of the executable code and runtime environment that allows use of various high-level languages on different computer platforms and architectures.
  • Reasons that make C# a widely used professional language
    • It is a modern, general-purpose programming language
    • It is object oriented
    • It is component oriented
    • It is easy to learn
    • It is a structured language
    • It produces efficient programs
    • It can be compiled on a variety of computer platforms
    • It is a part of .Net Framework
  • Strong programming features of C#

    • Boolean Conditions
    • Automatic Garbage Collection
    • Standard Library
    • Assembly Versioning
    • Properties and Events
    • Delegates and Events Management
    • Easy-to-use Generics
    • Indexers
    • Conditional Compilation
    • Simple Multithreading
    • LINQ and Lambda Expressions
  • C# is part of .Net framework and is used for writing .Net applications.
  • Types of applications that can be written using the .Net framework

    • Windows applications
    • Web applications
    • Web services
  • Components of the .Net framework
    • Common Language Runtime (CLR)
    • The .Net Framework Class Library
    • Common Language Specification
    • Common Type System
    • Metadata and Assemblies
    • Windows Forms
    • ASP.Net and ASP.Net AJAX
    • ADO.Net
    • Windows Workflow Foundation (WF)
    • Windows Presentation Foundation
    • Windows Communication Foundation (WCF)
    • LINQ
  • Development tools for C# programming provided by Microsoft
    • Visual Studio 2010 (VS)
    • Visual C# 2010 Express (VCE)
    • Visual Web Developer
  • Visual C# Express and Visual Web Developer Express edition are trimmed down versions of Visual Studio and has the same appearance. They retain most features of Visual Studio.
  • A C# program consists of the following parts: Namespace declaration, A class, Class methods, Class attributes, A Main method, Statements and Expressions, Comments.
  • The program execution starts at the Main method.