Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)

Slides:



Advertisements
Similar presentations
Credit hours: 4 Contact hours: 50 (30 Theory, 20 Lab) Prerequisite: TB143 Introduction to Personal Computers.
Advertisements

Chapter 11: Classes and Objects
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Eight Sub and Function Procedures.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 4 – Introducing Algorithms, Pseudocode and.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Programming and Visual Basic.
Copyright © 2001 by Wiley. All rights reserved. Chapter 3: Variables, Assignment Statements, and Arithmetic Variables Assignment Statements Arithmetic.
Slide 1 Chapter 2 Visual Basic Interface. Slide 2 Chapter 2 Windows GUI  A GUI is a graphical user interface.  The interface is what appears on the.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Visual Basic Chapter 1 Mr. Wangler.
Modular Programming Chapter Value and Reference Parameters t Function declaration: void computesumave(float num1, float num2, float& sum, float&
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
INTRODUCTION TO ALGORITHMS PROGRAMMING. Objectives Give a definition of the term algorithm Describe the various parts of the pseudocode algorithm or algorithm.
Modular Programming Chapter Value and Reference Parameters computeSumAve (x, y, sum, mean) ACTUALFORMAL xnum1(input) ynum2(input) sumsum(output)
Problem Create a Windows-based application that will calculate the Gross Pay earned for a worker, given the number of hours worked and hourly pay rate.
Microsoft Visual Basic 2005 BASICS Lesson 4 Mathematical Operators.
CIS 115 Lecture 4.  Create a Windows-based application that will calculate the Gross Pay earned for a worker, given the number of hours worked and hourly.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 7.1 Test-Driving the Wage Calculator Application.
Visual C++ Programming: Concepts and Projects
Programming with Visual C++: Concepts and Projects Chapter 3B: Integral Data (Tutorial)
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
1 INTRODUCTION TO PROBLEM SOLVING AND PROGRAMMING.
CSCI 3327 Visual Basic Chapter 4: Control Statements in Visual Basic (Part 1B) UTPA – Fall 2011.
Fundamentals of GUI Programming. Objectives: At the end of the session, you should be able to: describe the guidelines that are used for creating user-friendly.
University of Sunderland CIF 102/FIF102 Fundamentals of DatabasesUnit 15 Programming in Microsoft Access using VBA Using VBA to add functionality.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Security Panel Application Introducing the Select Case Multiple-Selection Statement.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Class Average Application Introducing the Do...Loop While and Do...Loop Until.
Visual C++ Programming: Concepts and Projects Chapter 11B: Pointers (Tutorial)
Copyright © 2011 Pearson Addison-Wesley What is a Program Made Of? Keywords (Reserved Words) – Words with special meaning that make up a high-level programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 5A Repetition (Concepts)
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 18 – Student Grades Application Introducing.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Three Memory Locations and Calculations.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 2A Reading, Processing and Displaying Data (Concepts)
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 3B Integral Data (Tutorial)
Programming with Visual C++: Concepts and Projects Chapter 4B: Selection (Tutorial)
The Hashemite University Computer Engineering Department
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Comments, Conditional Statements Continued, and Loops Engineering 1D04, Teaching Session 4.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
Steps for Developing a Visual C# 2010 Application MIT By: S. Sabraz Nawaz.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Chapter 1: Introduction to Computers and Programming.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Visual Basic.NET Windows Programming
Introduction to Programming and Visual Basic
Chapter Topics 15.1 Graphical User Interfaces
Introduction to Visual Basic 2008 Programming
Tutorial 9 - Car Payment Calculator Application Introducing the while Repetition Statement Outline 9.1 Test-Driving the Car Payment Calculator Application.
An Introduction to Programming and VB.NET
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
Chapter 4 LOOPS © Bobby Hoggard, Department of Computer Science, East Carolina University / These slides may not be used or duplicated without permission.
Tutorial 12 – Security Panel Application Introducing the Select Case Multiple-Selection Statement Outline Test-Driving the Security Panel Application.
Use of Mathematics using Technology (Maltlab)
Lecture Set 3 Introduction to Visual Basic Concepts
Designing Algorithms for Multiplication of Fractions
Chapter (3) - Looping Questions.
Problem Solving Skill Area 305.1
Chapter 15: GUI Applications & Event-Driven Programming
See requirements for practice program on next slide.
Input, Variables, and Mathematical Expressions
F T T T F.
Presentation transcript:

Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)

Tutorial: Addition Program Problem Analysis – Create an addition program for double precision numbers Design – Sketch the interface – Identify required controls for input, processing and output – Identify the variables to store two numbers and their sum – Construct an algorithm for input, processing and output Programming with Visual C++: Concepts and Projects

Tutorial: Addition Program Development –Create the interface –Code the event handlers Testing Programming with Visual C++: Concepts and Projects

Design Programming with Visual C++: Concepts and Projects Interface sketch – Position each control object on the form as it should look in the finished product – Name each control object

Design (continued) Programming with Visual C++: Concepts and Projects

Design (continued) Programming with Visual C++: Concepts and Projects Control table – List the control objects from the interface sketch – Identify their usage (input, processing, output) – List any events associated with them

Design (continued) Programming with Visual C++: Concepts and Projects Data Table – Identify variables that will be required, by name – Assign a data type to each variable ( double in this case) – Describe the purpose of the variable

Design (continued) After the interface has been designed algorithms must be written for each event handler This program has a button The button has a click event handler requiring an algorithm Programming with Visual C++: Concepts and Projects

Design (continued) Algorithm 1.Declare variables 2.Read num1 3.Read num2 4.Compute sum 5.Display sum Programming with Visual C++: Concepts and Projects

Development Programming with Visual C++: Concepts and Projects Create the actual interface based on the preliminary sketch you did in the Design stage – Place control objects on the form – Set the properties of these objects

Development (continued) Programming with Visual C++: Concepts and Projects

Development (continued) Programming with Visual C++: Concepts and Projects

Development (continued) Programming with Visual C++: Concepts and Projects

Development (continued) The Development stage is where the code must be written for each event handler Before writing any Visual C++ code you must have a plan (an low-level algorithm) Ideally, from each line of the algorithm a Visual C++ statement can be constructed Programming with Visual C++: Concepts and Projects

Development (continued) Programming with Visual C++: Concepts and Projects

Development (continued) Programming with Visual C++: Concepts and Projects

Development (continued) Comments should be added to your code at regular intervals Comments are ignored by the compiler Comment syntax – Line comment Used for one line, or a portion of a line // – Block comment Used for multiple lines of comments /* … */ Programming with Visual C++: Concepts and Projects

Development (continued) Programming with Visual C++: Concepts and Projects

Testing Run the program and enter various numbers into the Textboxes – Check the displayed result for accuracy Programming with Visual C++: Concepts and Projects

Testing (continued) Programming with Visual C++: Concepts and Projects

On Your Own Modify the interface – Rearrange the control objects Add more operations – Implement addition, subtraction, multiplication and division – Additional buttons are required for each operation Programming with Visual C++: Concepts and Projects

On Your Own (continued) Programming with Visual C++: Concepts and Projects

On Your Own (continued) Programming with Visual C++: Concepts and Projects