Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 2: Working with 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

Module 6: Introduction to C Language ITEI102 Introduction to Programming Structure of C++ Program - Programming Terminologies - Microsoft Visual Studio.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Computer and Programming
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. ETC - 1 What comes next? Recursion (Chapter 15) Recursive Data Structures.
Distributed Systems Tutorial 1 - Getting Started with Visual C#.NET.
C# Programming: From Problem Analysis to Program Design1 2 Your First C# Program.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Course Introduction and Getting Started with C 1 USF - COP C for Engineers Summer 2008.
GTECH 731 Lab Session 2 Lab 1 Review, Lab 2 Intro 9/6/10 Lab 1 Review Lab 2 Overview.
Using Visual C++ and Pelles C
Creating a Console Application with Visual Studio
Object Oriented Software Development 1. Introduction to C# and Visual Studio.
DT265-2 Object Oriented Software Development 2 Lecture 3 : Windows Programming Lecturer Pat Browne
Lecture 2: An Introduction to J# and.NET. 2 MicrosoftIntroducing CS using.NETJ# in Visual Studio.NET 2-2 Objectives “Microsoft.NET is based on the.NET.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Getting Started Example ICS2O curriculum
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
1 Programming Concepts Module Code : CMV6107 Class Contact Hours: 45 hours (Lecture 15 hours) (Laboratory/Tutorial 30 hours) Module Value: 1 Textbook:
Teach.NET Workshop Series Track 4: AP Computer Science with.NET and J#
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
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.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Using Eclipse. What is Eclipse? The Eclipse Platform is an open source IDE (Integrated Development Environment), created by IBM for developing Java programs.
IT 211 Project Integration and Deployment Lab #11.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
IE 411/511: Visual Programming for Industrial Applications
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.
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.
Author: Loh Jianxiong Christopher Editors: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang.
Teach.NET Workshop Series Track 4: AP Computer Science with.NET and J#
A1 Visual C++.NET Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Quick Introduction The following.
1 Working with MS SQL Server Textbook Chapter 14.
Programming Concept Chapter I Introduction to Java Programming.
Our Environment We will exercise on Microsoft Visual C++ v.6 We will exercise on Microsoft Visual C++ v.6 because that is what we have in the univ. because.
Introduction In The Name Of Allah, The Beneficent, The Merciful.
Sample Application Multi Layered Architecture (n-tier): –Graphical User Interface (GUI): Forms, components, controls The Visual Designer in Visual Studio.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
EIE375 BlueJ: Getting Started Dr Lawrence Cheung.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Teach.NET Workshop Series Track 4: AP Computer Science with.NET and J#
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 2: Working with Visual.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Slide 1 What we'll cover here l Using the debugger: Starting the debugger Setting.
Author: Loh Jianxiong Christopher Contributions: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang, Tong Chun Kit, Tania Chattopadhyay.
Teach.NET Workshop Series Track 4: AP Computer Science with.NET and J#
Architecture Multi Layered Architecture (n-tier): Application: Model Controllers Database Access Graphical User Interface (GUI): Forms, components, controls.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
CSC 1201 LAB RULES Nouf Aljaffan (C) CSC 1201 Course at KSU.
Managing Database objects in Visual Studio and Team Foundation Server Presented by Sean P SQL Saturday - Phoenix 2016.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
Dive Into® Visual Basic 2010 Express
Chapter 2: The Visual Studio .NET Development Environment
Lecture 2 D&D Chapter 2 & Intro to Eclipse IDE Date.
Lecture 3: The J# Language
Social Media And Global Computing Introduction to Visual Studio
Understanding the Visual IDE
Our Environment We will exercise on Microsoft Visual C++ v.6
Using Eclipse.
Presentation transcript:

Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 2: Working with Visual Studio 2005

Working with VS Intro to Visual Studio What is Visual Studio 2005?

Working with VS 2005 Visual Studio Microsoft’s IDE A single IDE for all.NET development –For every.NET language –For every application type –Powerful, professional tool –

Working with VS 2005 Editions of Visual Studio Express : free IDE, one for each language / platform Standard : base line IDE (one for all languages and platforms) Professional : adds SQL Server Express for database access –this is the edition you get with MSDN Academic Alliance Team Editions Software engineering editions: Architect, Developer, Tester Include class designer, integrated testing & coverage tools, etc. Team Suite All 3 software engineering editions in one package Trial version available from MSDNAA Team Foundation Server The server-side component for the team editions / suite Source code control, process management, task/bug lists, reporting, etc. Built-in support for two processes: Agile and Waterfall

Working with VS Working with Visual Studio Let's work though an example…

Working with VS 2005 Example Let’s work through an example… Console-based application to process US Census data –Students build an application to mine real Census data –A Nifty assignment from SIGCSE 2005

Working with VS 2005 (1) Create a New Project…

Working with VS 2005 (2) Select Project Type… Here you pick language & type of application to build…

Working with VS 2005 (3) Code… Write code in the Code window (duh :-) –Use Solution Explorer for navigating between program files –A window isn’t visible? Make visible via View menu… Code window Solution Explorer

Working with VS 2005 (4) Run… I’m a huge fan of incremental development Press F5 at any time to build and run –Beware of “console flash”, manually keep console window open… namespace CensusDataApplication { class Program { static void Main(string[] args) { // keep console window open System.Console.Read(); } namespace CensusDataApplication { class Program { static void Main(string[] args) { // keep console window open System.Console.Read(); }

Working with VS 2005 (5) Visual Studio Modes VS operates in one of three modes: –Design, Running, or Debugging –If students can’t edit their code, they are probably still running!

Working with VS 2005 (6) The Census Data Application Here’s the program design: 1 * census.txt SMITH JOHNSON

Working with VS 2005 ReadCensusData Reads input file & returns collection of FamilyName objects: static ArrayList ReadCensusData(string filename) { string line, name; double freq; int rank; string[] tokens; char[] separators = { ' ' }; ArrayList names = new ArrayList(); // collection StreamReader reader = new StreamReader(filename); // open input file: line = reader.ReadLine(); while (line != null) // for each line, parse & create FamilyName: { // break line into 4 tokens: name, freq, cumulativeFreq, rank: tokens = line.Split(separators, StringSplitOptions.RemoveEmptyEntries); name = tokens[0]; freq = System.Convert.ToDouble(tokens[1]); rank = System.Convert.ToInt32(tokens[3]); names.Add( new FamilyName(name, freq, rank) ); line = reader.ReadLine(); } reader.Close(); // close file return names; // return collection! } static ArrayList ReadCensusData(string filename) { string line, name; double freq; int rank; string[] tokens; char[] separators = { ' ' }; ArrayList names = new ArrayList(); // collection StreamReader reader = new StreamReader(filename); // open input file: line = reader.ReadLine(); while (line != null) // for each line, parse & create FamilyName: { // break line into 4 tokens: name, freq, cumulativeFreq, rank: tokens = line.Split(separators, StringSplitOptions.RemoveEmptyEntries); name = tokens[0]; freq = System.Convert.ToDouble(tokens[1]); rank = System.Convert.ToInt32(tokens[3]); names.Add( new FamilyName(name, freq, rank) ); line = reader.ReadLine(); } reader.Close(); // close file return names; // return collection! }

Working with VS 2005 Main Program starts by reading input & outputting top 5 names: –input file should be placed in project's bin\Debug sub-folder static void Main(string[] args) { string username, s, filename; ArrayList namesCollection; FamilyName nameObj; System.Console.WriteLine("** Welcome to US Census Bureau Data Mining Program **"); // assume input file is in same directory as.EXE: filename = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "census.txt"); namesCollection = ReadCensusData(filename); System.Console.WriteLine(">>1990 Census data contains a total of " + namesCollection.Count + " family names<<"); // // output top 5 family names in the census data: // System.Console.WriteLine(">>Top 5 Family Names in the 1990 US Census<<"); for (int i = 0; i < 5; i++) { nameObj = (FamilyName) namesCollection[i]; s = string.Format("{0}. {1}", i+1, nameObj.Name); System.Console.WriteLine(s); } static void Main(string[] args) { string username, s, filename; ArrayList namesCollection; FamilyName nameObj; System.Console.WriteLine("** Welcome to US Census Bureau Data Mining Program **"); // assume input file is in same directory as.EXE: filename = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "census.txt"); namesCollection = ReadCensusData(filename); System.Console.WriteLine(">>1990 Census data contains a total of " + namesCollection.Count + " family names<<"); // // output top 5 family names in the census data: // System.Console.WriteLine(">>Top 5 Family Names in the 1990 US Census<<"); for (int i = 0; i < 5; i++) { nameObj = (FamilyName) namesCollection[i]; s = string.Format("{0}. {1}", i+1, nameObj.Name); System.Console.WriteLine(s); }

Working with VS 2005 Main (cont'd) Then we allow the user to search for a name: // // now let user search for names they are interested in... // System.Console.Write("Please enter a name you are interested in: "); username = System.Console.ReadLine(); while (!username.Equals("")) { username = username.ToUpper(); // Census data is in UPPER case // search through collection... int index; for (index = 0; index < namesCollection.Count; index++) { nameObj = (FamilyName) namesCollection[index]; if (nameObj.Name.Equals(username)) break; } // did we find matching family name? if (index == namesCollection.Count) // not found System.Console.WriteLine("Sorry, that name does not appear in the census data."); else System.Console.WriteLine(namesCollection[index].ToString()); System.Console.Write("Please enter a name you are interested in: "); username = System.Console.ReadLine(); } // // now let user search for names they are interested in... // System.Console.Write("Please enter a name you are interested in: "); username = System.Console.ReadLine(); while (!username.Equals("")) { username = username.ToUpper(); // Census data is in UPPER case // search through collection... int index; for (index = 0; index < namesCollection.Count; index++) { nameObj = (FamilyName) namesCollection[index]; if (nameObj.Name.Equals(username)) break; } // did we find matching family name? if (index == namesCollection.Count) // not found System.Console.WriteLine("Sorry, that name does not appear in the census data."); else System.Console.WriteLine(namesCollection[index].ToString()); System.Console.Write("Please enter a name you are interested in: "); username = System.Console.ReadLine(); }

Working with VS 2005 FamilyName Class Here's a very simple design for the FamilyName class: –we'll come back and improve this design in the next lecture… public class FamilyName { public string Name; public double RawPercentFreq; public int Rank; public FamilyName(string name, double percentFrequency, int rank) { this.Name = name; this.RawPercentageFreq = percentFrequency; this.Rank = rank; } public override string ToString() { string s; s = string.Format("{0}. {1}: {2} ({3}%)", this.Rank, this.Name, this.GetFormattedPercentageFrequency(), this.RawPercentageFreq); return s; } public string GetFormattedPercentageFrequency() {... } }//class public class FamilyName { public string Name; public double RawPercentFreq; public int Rank; public FamilyName(string name, double percentFrequency, int rank) { this.Name = name; this.RawPercentageFreq = percentFrequency; this.Rank = rank; } public override string ToString() { string s; s = string.Format("{0}. {1}: {2} ({3}%)", this.Rank, this.Name, this.GetFormattedPercentageFrequency(), this.RawPercentageFreq); return s; } public string GetFormattedPercentageFrequency() {... } }//class

Working with VS Features of Visual Studio IntelliSense Other helpful features File system layout

Working with VS 2005 IntelliSense IntelliSense is a fantastic advance –context-sensitive programming aid –reduces programming errors –encourages experimentation and exploration // Keep console window open until user is done… System.

Working with VS 2005 Other HelpFul Features Compilation errors are underlined like spelling mistakes Debugger –set breakpoints in margin, run, single-step — use as a teaching tool! Toolbar buttons: –indent / outdent –comment in / out View menu: –Class view

Working with VS 2005 Visual Studio File System Layout As a professional tool, VS produces lots of files: –solution (.sln) represents your program solution double-click on.SLN file to open an existing program in VS –project (.csproj) tracks source files, settings you have one project file for each compiled unit (.EXE,.DLL) –bin\Debug sub-directory contains.EXE & data files for example, this is where you put “census.txt”

Working with VS What's Next? Lab exercise #2…

Working with VS 2005