IS 135 Business Programming

Slides:



Advertisements
Similar presentations
Introduction to .NET Framework
Advertisements

Computer and Programming
Chapter 1 These slides for CSE 110 Sections are based in part on the textbook-authors’ slides, which are copyright by the authors. The authors state that.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Introduction to Java.
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
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.
Creating and Running Your First C# Program Telerik Software Academy Telerik School Academy.
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#
1 8/29/05CS360 Windows Programming Professor Shereen Khoja.
Intro to C# Dr. John P. Abraham UTPA. Background required Thorough C++ programming – If you made an A in 1370/1170 you will do fine with some effort.
Module 1: Introduction to C# Module 2: Variables and Data Types
.NET Overview. 2 Objectives Introduce.NET –overview –languages –libraries –development and execution model Examine simple C# program.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to .NET Framework
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
C# B 1 CSC 298 Writing a C# application. C# B 2 A first C# application // Display Hello, world on the screen public class HelloWorld { public static void.
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.
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
Computing with C# and the.NET Framework Chapter 1 An Introduction to Computing with C# ©2003, 2011 Art Gittleman.
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.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
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#
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
CHAPTER 1 INTRODUCTION. CHAPTER GOALS To understand the activity of programming To understand the activity of programming To learn about the architecture.
Fall 2006Slides adapted from Java Concepts companion slides1 Introduction Advanced Programming ICOM 4015 Lecture 1 Reading: Java Concepts Chapter 1.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
Chapter 1 Introduction. Chapter Goals To understand the activity of programming To learn about the architecture of computers To learn about machine code.
Object Oriented Software Development 4. C# data types, objects and references.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
COP 2551 Introduction to Object Oriented Programming with Java Topics –Introduction to the Java language –Code Commenting –Java Program Structure –Identifiers.
ITP 109 Week 2 Trina Gregory Introduction to Java.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
Chapter 3 Introducing Java. Objectives and Goals 1. Define terminology associated with object- oriented programming. 2. Explain why Java is a widely used.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
C# Diline Giriş.
Introduction to Visual Basic. NET,. NET Framework and Visual Studio
Lecture 1b- Introduction
Introduction to .NET Framework
GC101 Introduction to computer and program
Key Ideas from day 1 slides
Introduction to Visual Basic 2008 Programming
Text by: Lambert and Osborne
C# and the .NET Framework
Introduction to .NET Framework Ch2 – Deitel’s Book
Chapter 2 First Java Programs
Java programming lecture one
Introduction to C# AKEEL AHMED.
Lecture 1 Making a C# GUI Program
Advanced Programming Lecture 02: Introduction to C# Apps
Chapter 3 Classes and Objects
Introduction CSC 111.
Chapter 3 – Introduction to C# Programming
(Computer fundamental Lab)
Running a Java Program using Blue Jay.
Computer Programming-1 CSC 111
C# and ASP.NET Programming
CS313T Advanced Programming language
Presentation transcript:

IS 135 Business Programming .NET and Visual Studio IS 135 Business Programming

.NET Framework The most recent MS announcement An attempt to enter the “enterprise” arena Good programmer tools Excellent access to universal resources Will allow many languages Large Base Library for all languages

.NET Continued Only on Windows at the moment However, the Intermediate Language (IL) that results from compilation is possibly machine independent This portable executable (PE) is part of the familiar .EXE file

.NET Continued The idea is to create programs in .NET Compile them in the “common language runtime” (CLR)… more later The code is translated into native code Any language that is compliant will run

.NET Continued MS used existing concepts and improved on them to create .NET It has: robust CLR Extensive class library Internet based inter process communication Multiple languages

.NET Framework Operating System Web Forms WIN forms Web Services Data Access XML Classes Base Classes .NET Framework Operating System

Class Library Saves you writing common routines Contains over 2500 classes Classes contain commonly used routines like printing, display etc Available to all languages under .NET through CLR

.Net and C# Structure

Start Page

Programming Environment

Execution Screen

CLR- Simplify App Dev 2500 classes, programmer can reuse Organizations can create their own reusable code Memory management simple with auto garbage collection

CLR - Performance High level languages always worse than assembler JIT compiles method into native code first Next time it executes directly in native code Allocation of memory is next available storage Deallocation done by garbage collector

Why CLR? Without it, compiler has to create safety But there are many compilers, some 3rd party All languages do not have safety features Some compiler implementations are slow

CLR Design Interpreter or compiler Interpreter does work at runtime, slow Modern systems, have front-end compiler, back-end runtime

CLR – Intermediate Language Front end does all checking, creates IL JIT can create reusable native code Better runtime performance

CLR and JVM Java Virtual Machine widely used Very similar to CLR Most important differences: CLR supports many languages Java implemented on many platforms

Types Other OOs call them a class Abstraction of data and behavior together Fields, methods, properties, events

Common Type System Provides wide range of modern operations Shared by CLR, compilers, tools Framework for cross-language operation Integer 16 on some machines, 32 on others Limited code reuse between languages Each language has some types CTS establishes rules for cross-language calls

Managed Data, Garbage Collect CLR reserves a contiguous block for initialized data – Managed Heap Fast allocation from it Older languages had to search for available space CLR performs deallocation as part of garbage collection When memory is low, frees up unreferenced memory

Getting started … From Program select Visual Studio .NET Be sure to select NEW PROJECT Then Visual C# Project and From the right hand window choose CONSOLE APPLICATION In the bottom window change the NAME to your assignment number

OUR style Rules After USING statement, there are /// (comments) Keep // but replace line 1 with YOUR NAME After // in line 2 replace text with the assignment # After // in line 3 replace text with DUE date Always insert a comment after } Ex: } // end namespace Now look at the example…

Helpful Hints No semicolons when: Next character is a { The current character is a } The line of text is over 1 line long For the next few weeks, every program will have a Main() method.

Example Please watch carefully… First we will enter VS, C# Then we will modify the skeleton program We will try to make it run First compile (check syntax etc) Build solution Correct errors Run program Debug, Start w/o debugging Check results Print results (next slide)

How to print program, results From Visual studio, print program Run the program (Debug/Start) With the output (black) screen visible: press print screen on top of keyboard on top left of black screen right click icon press select all again press copy Start WORD, paste copied material there

Assignment 0 Due Date: NEXT CLASS Write a program to display 3 lines of text. Line 1 your name Line 2 your grad year Line 3 your major Display instruction in C#: Console.WriteLine(“XXX”); (where XXX is the text to be displayed)

How to get started Turn off the monitor get paper and pen What results are expected? What data are you given? Is that enough to produce output? In English, list variables if needed List steps needed to display results ex: display my name Write C# instructions Turn on Monitor, enter program

Assignment 0a Due Date: Next Class Write a program to allow user input for name, reason for taking course, and your major.

Develop logic Turn off the monitor get paper and pen What output is expected? What data are you given? Is that enough to produce output? In English, list variables if needed List steps needed to meet user request ex: allow user input for name display my name … Write C# instructions Turn on Monitor, enter program

More on Input/Output Console.Readline(); Console.Write (or WriteLine); Example: string Name; // declare variable Name=Console.ReadLine(); Console.WriteLine(“My name is ” + Name); or Console.WriteLine(“My name is {0}”, Name);

More on Input/Output string name; string street; What would go here? string city; Console.Write(“Please enter your Name ”); name = Console.ReadLine(); Console.Write(“Please enter your Street ”); street = Console.ReadLine(); What would go here? city = Console.ReadLine(); Console.WriteLine(“my bio {0} {1}, {2}”, name, street, city); Output: my bio smith 123 street, ffld

Program Style We listed some // comments earlier We also should have 4 sections in every program // declare section (where you assign variables etc) // input section (accept user input) // computations (where you do calculations) // display results IN THAT ORDER

using System; namespace WTprog1 { // wt // program 1 // due date: 1/31/05 class Class1 static void Main(string[] args) // declare section // input section // computation section // display section { // end Main { //end class { // end namespace