Labs for week 2.

Slides:



Advertisements
Similar presentations
Control structures Part 2 iteration control To enable repetition of a statement block.
Advertisements

Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
CS0004: Introduction to Programming Variables – Numbers.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
1 Visual Basic for Applications (VBA) for Excel Prof. Yitzchak Rosenthal.
InvEasy (Project1) Please use speaker notes for additional information!
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)
Long Division. We are going to try to solve 837 ÷ 27.
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.
Class 3 Remote Instruction Computer Math EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure your volume is.
Applications Development
COMPUTER PROGRAMMING I SUMMER Apply operators and Boolean expressions.
Graphical User Interface You will be used to using programs that have a graphical user interface (GUI). So far you have been writing programs that have.
1 Advanced Computer Programming Lab Calculator Project.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Exceptions, handling exceptions & message boxes Year 11 Information Technology.
This will all add up in the end. Assignment operator =Simple Assignment operator Arithmetic Operators +Additive operator – Subtraction operator * Multiplication.
1 Chapter 3 – Examples The examples from chapter 3, combining the data types, variables, expressions, assignments, functions and methods with Windows controls.
VAT Calculator program Controls Properties Code Results.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 3B Integral Data (Tutorial)
Created by Alia Al-Abdulkarim 2008 Visual Basic Vs. Java.
COMPUTER PROGRAMMING I SUMMER Apply operators and Boolean expressions.
Davisware GlobalEdge 2008 Payroll Main Menu Time Entry and Payroll Processing.
Lesson 1. Security At the menu bar at the top you will see the word Tools. Click your mouse on Tools scroll down to Macro. Move the Mouse over and down.
Chapter 61 Example : For … To… Step For index = 0 To n Step s lstValues.Items.Add(index) Next Control variable Start value Stop value Amount to add to.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Calculator Program Explained by Arafa Hamed. First Designing The Interface Ask yourself how many places are there that will be used to input numbers?
مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.
Visual Basic 6 Programming Decide how many variables you need by looking at this form. There is one textbox for input and there are 3 labels for output,
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Visual Basic Declaring Variables Dim x as Integer = 0 In the statement above, x is being declared as an Integer (whole number) and is initialised.
Computer Science Up Down Controls, Decisions and Random Numbers.
Use TryParse to Validate User Input
Visual Basic Fundamental Concepts
5.03 Apply operators and Boolean expressions
A variable is a name for a value stored in memory.
Unit 9.1 Learning Objectives Data Access in Code
Long Division Methods Method 1.
Introduction to Programming
Tutorial 10 – Class Average Application Introducing the Do…Loop While and Do…Loop Until Repetition Statements Outline Test-Driving the Class Average.
Apply Procedures to Develop Message, Input, and Dialog Boxes
2.5 Another Java Application: Adding Integers
Variables and Arithmetic Operations
3.01 Apply Controls Associated With Visual Studio Form
Single Dimensional Arrays
Introduction to Programming
Use TryParse to Validate User Input
3.01 Apply Controls Associated With Visual Studio Form
3rd prep. – 2nd Term MOE Book Questions.
3rd prep. – 2nd Term MOE Book Questions.
CHAPTER FIVE Decision Structures.
Variables and Arithmetic Operations
Chapter 4 LOOPS © Bobby Hoggard, Department of Computer Science, East Carolina University / These slides may not be used or duplicated without permission.
Visual Basic..
Department Array in Visual Basic
Review # 2 Math 8.
More Loops.
Escape sequences: Practice using the escape sequences on the code below to see what happens. Try this next code to help you understand the last two sequences.
CSC235 - Visual Studio Tutorial
Additional Topics in VB.NET
Adding Record To Your Database
VB Variables and Data
Using screens and adding two numbers - addda.cbl
See requirements for practice program on next slide.
Introduction to Programming
Java Programming with BlueJ Objectives
Text / Serial / Sequential Files
CHAPTER FOUR VARIABLES AND CONSTANTS
Presentation transcript:

Labs for week 2

First…Week2 lab1 Practice using the \ (integer mod) operator in a form. Provide a textbox for input and a textbox or label for output, and a button to start computation. In the button_clicked subroutine declare variables: Dim inputint, onesdigit as Integer Now, get input from textbox and convert into an integer. (Recall: use Integer.parse(..) Code for this step not shown but is in previous lab and powerpoints.) Next get the one’s place off the input value. Code to get the one’s place: Onesdigit=inputint mod 10 ‘ gives remainder on division by 10 (display onesdigit in textbox or label… code not shown)

Continue… Lab2 The digit extractor project needs to keep getting more digits, but if you execute Onesdigit=inputint mod 10 again, you get the same thing. Change inputint as follows: inputint=inputint \10 ‘integer division Now try Dim tensdigit as integer tensdigit=inputint mod 10 And then display tensdigit in a another label or textbox.

Lab3. Checking for data entry error The payroll project requires input error checking. Build a form with a textbox for input, a label for output, and a button to initiate action. Use code from our first week lab in button click: Dim value as double Value=double.parse(txtinput.text) Lbloutput.text=value.tostring(“n3”)

Now add error-checking Add the code to check for a numeric input error. Notes for this appear in the 2nd powerpoint for the course in the book-order form application as well as in the next slide.

Adding input error checking Try ‘ put the get, parse and display code here Catch theexception As FormatException ‘put errorhandling code here…like… MessageBox.Show("Data entry error“) End Try