1 Lab Session-I (A and B) CS-120 Fall 2000 Using Windows Using An Editor Using Visual C++ Using Compiler Writing and Running Programs Lab-1 DUE Fri September.

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

Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
 C++ programming facilitates a disciplined approach to program design. ◦ If you learn the correct way, you will be spared a lot of work and frustration.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
1 Lab Session-II CSIT 121 Fall 2000 Visual Studio Introduction Lab-1 Explanation and Demos Debugging Tips How to add new files to your projects How many.
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
1 Session-I & II CSIT-121 Spring 2006 Session Targets Introducing the VC++.NET Solving problems on computer Programming in C++ Writing and Running Programs.
01 Introduction1June Introduction CE : Fundamental Programming Techniques.
1 Lab Session-I CSIT120 Spring2001 Using Windows Using An Editor Using Visual C++ Using Compiler Writing and Running Programs Lab-1 continues (Session.
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.
Guide To UNIX Using Linux Third Edition
A Visual Introduction to PC SAS. Start SAS by double-clicking on the SAS icon...
MBAC 611.  We have been using MS Access to query and modify our databases.  MS Access provides a GUI (Graphical User Interface) that hides much of the.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
A First Program Using C#
Visual Basic Chapter 1 Mr. Wangler.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
Introduction to the WebBoard Terry Dennis. The WebBoard - Our Connection The WebBoard URL is
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
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.
General Programming Introduction to Computing Science and Programming I.
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.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
History of C and C++ C++ evolved from C ANSI C C++ “spruces up” C
PHP meets MySQL.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
A1 Visual C++.NET Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Quick Introduction The following.
CPS120: Introduction to Computer Science Compiling Your Programs Using Visual C++
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
1 Special Programming Workshop CSIT-120 Fall 2000 Workshop Targets Solving problems on computer Programming in C++ Writing and Running Programs Programming.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Comments in Java. When you create a New Project in NetBeans, you'll notice that some text is greyed out, with lots of slashes and asterisks:
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Chapter 3 The Visual Basic Editor. Important Features of the VBE Alt-F11 will open the Visual Basic Editor. The Code window is to the right, Project Explorer.
1.NET Web Forms Visual Studio © 2002 by Jerry Post.
Editors And Debugging Systems Other System Software Text Editors Interactive Debugging Systems UNIT 5 S.Sharmili Priyadarsini.
GISMO/GEBndPlan Overview Geographic Information System Mapping Object.
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
11 ITI 1120 Lab # 2 Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
STRUCTURED PROGRAMMING Complete C++ Program. Content 2  Main Function  Preprocessor directives  User comments  Escape characters  cout statement.
Visual Basic.NET Windows Programming
The eclipse IDE IDE = “Integrated Development Environment”
Great way to learn is by example so fire up Visual Studios C (at home make sure you custom install with C++ - no longer default) by Deborah R. Fowler.
Beginning C++ Programming
1. Introduction to Visual Basic
Chapter 1: Introduction to SAS
Programming Fundamentals Lecture #3 Overview of Computer Programming
Running a Java Program using Blue Jay.
Presentation transcript:

1 Lab Session-I (A and B) CS-120 Fall 2000 Using Windows Using An Editor Using Visual C++ Using Compiler Writing and Running Programs Lab-1 DUE Fri September 8 Lab-1 continues (Session I-B)

2 Lab Targets We wish to learn how to program We would like to edit a program, compile it and run it successfully Therefore we need to learn editing, compiling and running programs This can be done under MS-Windows operating system easily

3 Using Windows MS-Windows is a user friendly system Mouse clicks in GUI environment make it easy to use the system. Switching from one task to another is done through various ways Cutting and pasting from one application to another is convenient way to share data

4 Using an Editor First, we should learn basic editing under Windows operating system We need to know how to correct a mistake, cut and paste text and save a file Let us do some practice sessions as prescribed in the manual. Please do experiment 1.1 in lab session 1

5 Suggested Editors Under Ms-Windows, Wordpad and Notepad are available as editors that can handle text files Wordpad is better than Notepad as it remembers previously edited files Please save the file as “Text file--MS-DOS format” if you wish to give it an extension of.cpp (C++ source code file) or save as “all files” under Notepad

6 Using Visual C++ Visual C++ is part of MS Visual Studio package Visual C++ is easy to use because of its integrated development environment It implements the C++ programming language and offers many choices for structured or object-oriented programming

7 Using A Compiler We will be using Visual C++ for this course as our programming environment Visual C++ can be started from the Start button Go to “file==>new==>files==>C++Source File” to start editing a new source code file. Visual C++ provides its own editor Perform Experiment 1.2 in session1 of lab manual

8 Using A Compiler Please save your file once you are done editing it. The default name of your file would be Cpp1.cpp. Change it if you do not like this name. Now go to menu options “Build==>Build” It will ask you some funny question(s), say “Yes” to all Once built, the project can be executed from “Build==>Execute” or “!” icon

9 Visual C++ Projects Visual C++ likes to work with projects so that you can create many small source code files and compile these together as one coherent program Visual C++ has already created for you a project with several files. Let us look at all those files

10 How many files? Use Explorer or winfile to check out all the files that Visual C++ creates for your project.exeExecutable program file.objMachine code for every source file.ilkLinker uses this file to avoid re-linking code that was not modified

11 How many files?.pchPre-compiled header file.pdbDebugging information.idbAdditional debug information

12 The Anatomy of a C++ Program Let us explore the structure of the C++ program that we have compiled and executed. The program began with comments line. All comments start with “//” or “/*”. Comments do not contribute anything in the program. Comments are for readers to understand the program later.

13 The Anatomy of a C++ Program You are expected to put comments at all important places so anyone else can read and understand your source code The line with –#include is a directive to include a “header” file. Header files contain names of the functions to be used by the program.

14 The Anatomy of a C++ Program C++ provides a lot of built-in functions so that programmers do not have to re-invent the wheel For example, displaying something on screen is a task. Everyone is not supposed to develop a program to do it C++ developers have already written a “program” to do it. All you need to do is to call that program by its name

15 The Anatomy of a C++ Program cout<< is the way to call the standard I/O function cout which displays your data on the screen Next we see the line –void main(void) This line gives the name of the function that you are developing. main() is the default name used for the main function of any program

16 The Anatomy of a C++ Program Function is a block of code that performs a given task. A function carries a name and opening and closing braces. If there is only one function in your program, it must be named main(). If there are two or more functions in your program, one of the functions must be named main() All function names are unique in a program

17 The Anatomy of a C++ Program The function main is started with an opening brace { and terminated with a closing one } These braces identify the start and end of a block of code. e.g. a function We will identify some more uses of these braces in future

18 Lab-1 Due 9/8/2000 Please submit your report of experiment 1.1 and experiment 1.2. Perform one of the post lab problems as listed on page 11 of the lab manual and submit your report Reports can be put in my mailbox in the department or given in class on Friday September 8th

19 Lab-1 Continues (Session I-B) We have learned –How to use a text editor in Windows –How to use Visual C++ –How to compile, build and run programs in Visual C++ We should strengthen our knowledge by doing some more examples

20 Q&A Why is included in the program source code? Why do we name the only function in our program as main()? What is the use of opening braces and closing braces in the program? What is a header file? What is cout<<? Why do we put semicolons at the end of each statement?

21 Lab Experiments We can introduce errors in our source code and then check the compiler error messages Perform Experiment 1.3 on page 8 of lab manual session-1

22 Lab Experiments The little character “\n” inserts a newline in the display. We can use it whenever we want the next item to begin on a new line Perform Experiment 1.4 to learn of the effects of placing \n in the middle or end of displayed text strings Perform Experiment 1.6 to learn of the rules about placing quotation marks in the text.

23 Practicing ASCII Art Right now we have the expertise of using the output statement cout in displaying text We can use this expertise to display several different things. For example, let us see how to show a triangle with this statement Can you write a program to show a triangle or a square, or an automobile with cout?