Computer Programming 1.  Editor Console Application Notepad Notepad++ Edit plus etc.  Compiler & Interpreter Microsoft.NET Framework  Microsoft visual.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Computer and Programming
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
Getting Started with C# 1 SWE 344 Internet Protocols & Client Server Programming.
Programming by Example Version 1.0. Objectives Take a small computing problem, and walk through the process of developing a solution. Investigate the.
תכנות ב C#. דוגמא לפלט using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void.
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
Distributed Systems Tutorial 1 - Getting Started with Visual C#.NET.
Introduction to Computing and Programming
C# Programming: From Problem Analysis to Program Design1 2 Your First C# Program.
 Tim Wagner Visual Studio Platform Dev Manager Microsoft Corporation TL32.
Creating a Console Application with Visual Studio
C# Tutorial From C++ to C#. Some useful links Msdn C# us/library/kx37x362.aspxhttp://msdn.microsoft.com/en- us/library/kx37x362.aspx.
Basic Input - Output. Output functions  printf() – is a library function that displays information on-screen. The statement can display a simple text.
Computer and Programming File I/O File Input/Output Author: Chaiporn Jaikaeo, Jittat Fakcharoenphol Edited by Supaporn Erjongmanee Lecture 13.
(c) Bob McKillop, 2006Tutorial #1 T1-1 Tutorial #1 - your first compiled code  the learning objectives for this tutorial are very modest q compile and.
1. 2 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Decisions { class.
Reading and Writing to the Console Svetlin Nakov Telerik Corporation
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.
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.
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.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Computer Programming for Engineers Introduction to Programming in C Language on Visual C Platform Intro. Comp. Prog. C-Language1.
3. Declaring Value-Type Variables
Introduction to Java Thanks to Dan Lunney (SHS). Java Basics File names The “main” method Output to screen Escape Sequence – Special Characters format()
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
1 Introduction to C# Programming Console applications No visual components Only text output Two types MS-DOS prompt - Used in Windows 95/98/ME Command.
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#
 Simple C# program  Console applications input and output text in a console window, which in Windows XP and Windows Vista is known as the Command Prompt.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Introduction to Visual Basic.NET Your First Visual Basic.NET Application.
Chapter 2: Using Data.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Intro to More Controls in C#. C# Demonstration We already touched on labels and buttons Ad-hoc demo of controls – Textboxes Multiline – Checkbox – Radiobutton.
Features of Object Oriented Programming:  A class is a collection of things which posses common similarities.  In C#.NET a class is a user defined.
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
1 st Semester Module2 Basic C# Concept อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
CS590VC – Tutorial 6 Client-side connection through external application.
Reading and Writing to the Console Svetlin Nakov Telerik Corporation
ITF11012.NET Demo. Hello HiOf Hello Windows 8 App Samples / Links.
Programming by Example Version 1.1. Objectives  Take a small computing problem, and walk through  the process of developing a solution.  Investigate.
1 Introduction to C# Programming Console applications No visual components Only text output Two types MS-DOS prompt - Used in Windows 95/98/ME Command.
Introduction to Database using Microsoft Access 2013 Part 6.1 November 18, 2014.
C# Introduction Part 1. Which Visual Studio Should I use? Any Express (2012, 2013…) or Community Edition 2013 Any full version.
Input & Output Statement
Console Input / Output Reading and Writing to the Console SoftUni Team Technical Trainers Software University
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 – Introduction to C# Programming Outline 3.1 Introduction 3.2 Simple Program: Printing a Line.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
INPUT/OUTPUT STATEMENT ADDITION SLIDES. Console.ReadLine() – Use to get the input (String) from user Convert string to other data type – int.Parse() 
Course Title Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
1/16: Intro to Java, Languages, and Environments Types of programming languages –machine languages –assembly languages –high-level languages Java environment.
1 st Semester Module2 Basic C# Concept อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
1 Statements © University of Linz, Institute for System Software, 2004 published under the Microsoft Curriculum License.
Input/Output Statement Thanachat Thanomkulabut. Input Statement  Console.ReadLine()  Return string  Use to get the input from user  Convert string.
Building C# Applications
C# Basic Syntax, Visual Studio, Console Input / Output
C# Basic Syntax, Visual Studio, Console Input / Output
C# — Console Application
using System; namespace Demo01 { class Program
OUTPUT STATEMENTS GC 201.
Functions Used to write code only once Can use parameters.
Advanced Programming Lecture 02: Introduction to C# Apps
Understanding the Visual IDE
Java Intro.
Lab 1 Introduction to C++.
Chapter 3 – Introduction to C# Programming
CSE Module 1 A Programming Primer
IS 135 Business Programming
Presentation transcript:

Computer Programming 1

 Editor Console Application Notepad Notepad++ Edit plus etc.  Compiler & Interpreter Microsoft.NET Framework  Microsoft visual studio 2005, 2008,(Full & Express)

 The contents of your first console app appear as follows: using …..// call class to use namespace …..// define definition of class { class …..// name of class { static void Main()// starting write to program { // programming area }

Along the left edge of the code window, you see several small plus (+) and minus (–) signs in boxes. Click the + sign next to using.... This expands a code region, a handy Visual Studio feature that keeps down the clutter. Here are the directives when you expand the region in the default console app: using System; using System.Collections.Generic; using System.Text;  using System; Contain every class ex. Console to use input & output to display on monitor

 Edit the test.cs template file until it appears as follows: using System; namespace ConsoleAppTemplate { public class Program { static void Main(string[] args) { Console.WriteLine(“Hello World !”); Console.WriteLine(“I am a bird !! in the sky”); Console.Read(); }

 Console.WriteLine Display on monitor with add new line number on new cursor  Syntax:  Console.WriteLine(parameter);  Ex. Console.WriteLine(“Hello World!”);  Console.Write Display on monitor  Syntax:  Console.Write(parameter);  Ex. Console.Write(“Hello World!”);

Ex1. Console.WriteLine(“Hello World!”); Ex2.Console.Write (“Hello”); Console.Write (“ ”); Console.WriteLine (“World!”); This example are same as the result program Escape characterMean \nNewline \tHorizontal tab \”Double quotation mask \’Single quotation mask \\Backspace \rCarriage return \aAlert

using System; namespace ESCConsoleAppTemplate { public class Program { static void Main() { Console.WriteLine(“This line \tcontain two \ttabs”); Console.WriteLine(“This \ncontain new line”); Console.WriteLine(“This sound alert \a\a\a”); Console.WriteLine(“This \’ 555 \’”); Console.Read();// cursor waiting to any key }

Ex 3. Console.WriteLine(“Hello” + “World!”); Ex 4. String s = “Rujipan” Console.WriteLine(“My name is” + s + “and my Age is” + 33);  PlaceHolder Syntax: Console.WriteLine(“Statement {0} {1} {2} … {n}”,x0,x1,…,xn) {0} … {n}position to display x0 … xnvalue to {0}…{n} Ex 3. Console.WriteLine(“My name is {0} and Age is {1}”,”Boon”,45);

Syntax: {index [,alignment] [:format specific]}  Indexstarting 0  Alignmentamount of width display  Format specific FormatMean CCurrency as $ EExponential FFloating point GShot number NNormal number XHexadecimal number

using System; namespace DisplayFormat1 { public class Program { static void Main() { Console.WriteLine(“A={0} B={1}”,123,456); Console.WriteLine(“ ”); // 9 number display 1234XXXXXX=space Console.WriteLine(“{0,9}”,1234); Console.WriteLine(“ ”); // 9 number left align XXXXX1234 X=space Console.WriteLine(“{0,-9},1234”); Console.Read(); }

using System; namespace DisplayFormat2 { public class Program { static void Main() { Console.WriteLine(“{0:C}”, ); Console.WriteLine(“{0:E}”, ); Console.WriteLine(“{0:F}”, ); // floating point 2 position Console.WriteLine(“{0:F2}”, ); Console.WriteLine(“{0:G}”, ); Console.WriteLine(“{0:N}”, ); Console.WriteLine(“{0:X}”, ); Console.WriteLine(“{0,20:G}”, ); Console.Read(); }

using System; namespace ConsoleAppTemplate { public class Program { static void Main(string[] args) { Console.WriteLine(“Enter your name, please:”); string sName = Console.ReadLine(); Console.WriteLine(“Hello, “ + sName); Console.WriteLine(“Press Enter to terminate...”); Console.Read(); }