VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 3B Integral Data (Tutorial)

Slides:



Advertisements
Similar presentations
Chapter 31 Visual Basic Controls A Form is a windows-style screen displayed by Visual Basic programs. In a form, a programmer can create objects in a form.
Advertisements

Visual C++ Programming: Concepts and Projects
CODING SYSTEMS CODING SYSTEMS CODING SYSTEMS. CHARACTERS CHARACTERS digits: 0 – 9 (numeric characters) letters: alphabetic characters punctuation marks:
Variables, Constants, Methods, and Calculations Chapter 3 - Review.
Clearly Visual Basic: Programming with Visual Basic 2008
Chapter 4 Introduction to Numeric Data Types and Variables.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and.
Variables and Constants
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Interest Calculator Application Introducing the For...Next Repetition Statements.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.
Microsoft Visual Basic 2005 BASICS Lesson 4 Mathematical Operators.
Arithmetic operations and operators, converting data types and formatting programs for output. Year 11 Information Technology.
Visual Basic.NET BASICS Lesson 4 Mathematical Operators.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 3A Integral Data (Concepts)
Copyright 1999 by Larry Fuhrer. Pascal Programming Getting Started...
Chapter 2: Using Data.
Number Systems Ron Christensen CIS 121.
Microsoft Visual Basic 2005 CHAPTER 4 Variables and Arithmetic Operations.
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.
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.
Type Conversions Implicit Conversion Explicit Conversion.
Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Visual C++ Programming: Concepts and Projects Chapter 11B: Pointers (Tutorial)
Computing with C# and the.NET Framework Chapter 2 C# Programming Basics ©2003, 2011 Art Gittleman.
Visual C++ Programming: Concepts and Projects Chapter 12B: Linked List (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.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 5A Repetition (Concepts)
Programming with Visual C++: Concepts and Projects Chapter 3A: Integral Data (Concepts)
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.
Concepts of Database Management Seventh Edition Chapter 3 The Relational Model 2: SQL.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 2A Reading, Processing and Displaying Data (Concepts)
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 7 Where Can I Store This?
Lesson 4 Mathematical Operators! October 6, 2009.
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
Programming with Visual C++: Concepts and Projects Chapter 4B: Selection (Tutorial)
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Chapter 3 AS3 Programming. Introduction Algorithms + data structure =programs Why this formula relevant to application programs created in flash? The.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
Visual C++ Programming: Concepts and Projects Chapter 10B: Recursion (Tutorial)
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
CONVERTING TO RATIONAL NUMBERS. Whole numbers are 0, 1, 2, 3, 4, … Integers include all the whole numbers and also their negative versions: …, -3, -2,
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
Introduction to Algorithmic Processes CMPSC 201C Fall 2000.
Making Interactive Programs with Visual Basic .NET
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are used in programs so that values can be represented with.
© 2006 Lawrenceville Press Slide 1 Chapter 4 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration statement. For example: Dim.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
Microsoft Visual Basic 2010 CHAPTER FOUR Variables and Arithmetic Operations.
Some basic concepts underlying computer archi­tecture
Visual C++ Programming: Concepts and Projects
Computer Science 210 Computer Organization
IS 350 Numeric Data Types.
A variable is a name for a value stored in memory.
Arithmetic operations and operators, converting data types and formatting programs for output. Year 11 Information Technology.
CSCI 198: Lecture 4: Data Representation
CSCI 161: Lecture 4: Data Representation
Variables and Arithmetic Operations
Variables and Arithmetic Operations
Tutorial 12 – Security Panel Application Introducing the Select Case Multiple-Selection Statement Outline Test-Driving the Security Panel Application.
Computer Science 210 Computer Organization
Presenting information as bit patterns
Data Types and Expressions
F T T T F.
Chapter 2 Modular Programs with Calculations and Strings
Presentation transcript:

VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 3B Integral Data (Tutorial)

Tutorial: Binary Conversion Program Visual C++ Programming 2  Problem Analysis  Construct a program that allows the user to enter a character and see its decimal (base-10) and binary (base-2) representations  For example, if the user entered the letter ‘A’ Its binary representation is displayed Its decimal representation 65 is displayed

Visual C++ Programming 3

Problem Description Visual C++ Programming 4  The ASCII code of the letter is a base-10 integer – no explicit conversion required!  To calculate the binary representation  Start with the largest binary place value (128)  Determine how many whole times the place value goes into the integer in question (using integer division)  Display the result  Capture the remainder (using mod)

Visual C++ Programming 5

6

7

8

Design Visual C++ Programming 9  Interface sketch requires numerous textboxes  Data entry (txtChar)  Data output Eight textboxes for the binary digits One textbox (txtDec) for the decimal version  Control table  Data table  Algorithm for the button (btnConvert)

Visual C++ Programming 10

Visual C++ Programming 11

Visual C++ Programming 12

Visual C++ Programming 13

Visual C++ Programming 14

Visual C++ Programming 15

Development Visual C++ Programming 16  Create the interface  Create, resize and position multiple textboxes  Set MaxLength property to 1 for txtChar  Set horizontal spacing  Add labels  Change ForeColor and BackColor  Assign names to match interface design  Add a textbox for instructions ( txtInstruct )

Visual C++ Programming 17

Visual C++ Programming 18

Visual C++ Programming 19

Visual C++ Programming 20

Visual C++ Programming 21

Visual C++ Programming 22

Visual C++ Programming 23

Visual C++ Programming 24

Visual C++ Programming 25

Visual C++ Programming 26

Visual C++ Programming 27

Visual C++ Programming 28

Visual C++ Programming

Development (continued) Visual C++ Programming 30  Code Form1_Load() event handler  Code btnConvert_Click()  Assign first character in txtChar to variable  Assign character to an integer variable and display  Display groups of 128  Calculate remainder  Display other place values

Visual C++ Programming 31

Visual C++ Programming 32

Visual C++ Programming 33

Visual C++ Programming 34

Visual C++ Programming 35

Visual C++ Programming 36

Visual C++ Programming 37

Visual C++ Programming 38

Visual C++ Programming 39

Testing Visual C++ Programming 40  Demonstrate that your program works with  A-Z characters  a-z characters  0-9 numerals  Punctuation marks and special characters  Use the ASCII table in Appendix B to verify correctness

Visual C++ Programming 41

On Your Own Visual C++ Programming 42  Demonstrate your understanding  Create a diagram like Figure 3-28 to show how your program works with various decimal numbers  Replace ToString() with Convert::ToString()  Use shorthand operators /= %=