1 Lab Session-2 CSIT 121 Spring 2005 Debugging Tips NiMo’s Varying Rates Lab-2 Exercise.

Slides:



Advertisements
Similar presentations
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Advertisements

BIM313 – Advanced Programming Techniques Debugging 1.
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.
1 Session-5 CSIT 121 Spring 2006 Part D due now String Rules Chapter 2 Topics Lab Demo Exercise Assignment.
Computer Science-I (CSIT121) Dr. Junaid Ahmed Zubairi SUNY Fredonia Room 210, Fenton X-4694,
1 Lab Session-2 CSIT221 Spring 2003 b Intro to Object Oriented Programming b Practice Problem b Lab Exercise (Demo Required)
1 Lab-1 CSIT-121 Spring 2005 Lab Targets Solving problems on computer Programming in C++ Writing and Running Programs Programming Exercise.
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.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
1 Session-7 CSIT 121 Spring 2006 Lab Demo of NiMo Lesson 3-2 Exercises 1,2,3,4,5,6 (Arithmetic Operators with Program ‘Convert.cpp’) Q&A about operators.
1 Lab Session-I CSIT120 Spring2001 Using Windows Using An Editor Using Visual C++ Using Compiler Writing and Running Programs Lab-1 continues (Session.
Guidelines for working with Microsoft Visual Studio.Net.
1 Lab Session-6 CSIT-121 Spring 2005 Structured Choice The do~While Loop Lab Exercises.
1 Lab Session-VII CSIT-121 Fall Revising Previous Lab and performing ASCII chart printing experiment (DEMO) 4 Visual Studio Features 4 The While.
Guidelines for working with Microsoft Visual Studio 6.
1 Lab Session-3 CSIT 121 Spring’05 Division rules Operator precedence rules Lab Exercise.
Chapter 12: Advanced Topics: Exception Handling Visual Basic.NET Programming: From Problem Analysis to Program Design.
CIT 590 Debugging. Find a laptop Please take a moment to open up your laptop and open up Eclipse. If you do not have a laptop, please find a friend. If.
1 Lab Session-III CSIT-120 Spring 2001 Revising Previous session Data input and output While loop Exercise Limits and Bounds GOTO SLIDE 13 Lab session.
1 Session-4 CSIT 121 Spring 2006 Debugging Tips Lab Work.
1 Gentle Introduction to Programming Tirgul 2: Scala “hands on” in the lab.
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
Debugging Logic Errors CPS120 Introduction to Computer Science Lecture 6.
6 Steps of the Programming Process
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
Using a Debugger. SWC What is ”debugging”? An error in a computer program is often called a ”bug”… …so, to ”debug” is to find and get rid of errors in.
WaveMaker Visual AJAX Studio 4.0 Training Troubleshooting.
Debugging applications, using properties Jim Warren – COMPSCI 280 S Enterprise Software Development.
Debugging Projects Using C++.NET Click with the mouse button to control the flow of the presentation.
A1 Visual C++.NET Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Quick Introduction The following.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
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.
How to start Visual Studio 2008 or 2010 (command-line program)
ENEE150 – 0102 ANDREW GOFFIN Testing and Debugging.
CSE 232: C++ Programming in Visual Studio Graphical Development Environments for C++ Eclipse –Widely available open-source debugging environment Available.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
CS Class 05 Topics  Selection: switch statement Announcements  Read pages 74-83, ,
Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.
1 SEEM3460 Tutorial Compiling and Debugging C programs.
CS320n –Visual Programming More LabVIEW Foundations.
CSE 351 GDB Introduction. Lab 1 Status? How is Lab 1 going? I’ll be available at the end of class to answer questions There are office hours later today.
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
Georgia Institute of Technology Creating Classes part 2 Barb Ericson Georgia Institute of Technology June 2006.
COP 3530 Spring2012 Data Structures & Algorithms Discussion Session Week 2.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
Open project in Microsoft Visual Studio → build program in “Release” mode.
Debug in Visual Studio Windows Development Fundamentals LESSON 2.5A.
5.01 Understand Different Types of Programming Errors
CSC 1201 LAB RULES Nouf Aljaffan (C) CSC 1201 Course at KSU.
An introduction to the debugger And jGrasp editor-syncrasies (ideosyncrasies)
COMPUTER PROGRAMMING I SUMMER Understand Different Types of Programming Errors.
Netbeans QuickStart. Creating a project File->New Project –For now you want General->Java Application –Then fill in the project details.
CIS 115 AID Peer Educator/cis115aid.com FOR MORE CLASSES VISIT
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
1 Project 12: Cars from File. This is an extension of Project 11, Car Class You may use the posted solution for Project 11 as a starting point for this.
DEBUG.
5.01 Understand Different Types of Programming Errors
ACOE301: Computer Architecture II Labs
Computer Programming I
CIS115 Education for Service-- snaptutorial.com
CIS 115Competitive Success/tutorialrank.com
CIS 115 Teaching Effectively-- snaptutorial.com
Quick Start Guide for Visual Studio 2010
5.01 Understand Different Types of Programming Errors
Debuggers.
1. Open Visual Studio 2008.
Starting a project in VisualDSP++
Our Environment We will exercise on Microsoft Visual C++ v.6
jGRASP editor-syncrasies (idiosyncrasies)
Debugging.
Presentation transcript:

1 Lab Session-2 CSIT 121 Spring 2005 Debugging Tips NiMo’s Varying Rates Lab-2 Exercise

2 Some Aspects of Visual Studio Your project can be set in “Debug” or “Release” states ( Build->Set Active Configuration ) In “Debug” state, you can apply several debugging options. Debug is set by default You can start debugging by invoking the debugger

3 Debugging Tips Let us try a few simple steps Open your source file, make a mistake and try to recompile it (demo) The compiler gives an error message Click on the error message The compiler takes you to the line where the error is, press F1 to learn more

4 Starting the Debugger Once you have compiled the project, you can start the debugger by first inserting breakpoints A Breakpoint is where the program execution will halt Thus you can see the values of variables at that point

5 Using the Debugger Inserting breakpoints is very convenient way of stopping at a suspected problem location and examining the values of variables (Click the “hand” in the corner) Using “GO” causes the debugger to run the program until the next break point (Click on “Build”--> “Start Debug”-->GO)

6 NiMo’s varying rates Example: Niagara Mohawk wants to apply different rates to its customers. If a customer burns more than 1000 units in a month, rate B is applied else rate A is applied. Develop a program that outputs the monthly bill given a customer’s consumption. Test the program with two sample customers. One customer will have rate A (20 cents) applied and the other one will have rate B (17 cents) applied to the monthly bill.

7 NiMo’s varying rates You develop the data model and algorithm for this problem What is the input to your function? Answer: What is the output? Answer: What are the processing requirements? Answer (A or B)*consumption Write the algorithm on paper

8 NiMo’s varying rates In our example, the program can be divided into three sections: Write a code segment to get the rates Write a code segment to process the charges Write a code segment to output the charges (Input  Processing  Output)

9 Programming Exercise Due Feb 9 Extend the NiMo program by computing the monthly bill with the energy supply charge. Energy supply charge is different for rate A and rate B customers. For rate A customers, it is 10 percent of the energy bill. For rate B customers, it will be 8 percent of the bill. Add this charge to the bill and display the cumulative monthly bill with explanatory information.

10 Sample Run –How many units did you burn this month?1200 –Your Electricity Bill this month is –Energy Charges $204 –Supply Charges $16.32 –Total Charges excluding taxes $ –======================================= –How many units did you burn this month?900 –Your Electricity Bill this month is –Energy Charges $180 –Supply Charges $18 –Total Charges excluding taxes $198