Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Lab 12: Adding TextBox and Number Checking Procedures in BankProc Project, Lab Reports of Information Technology

The steps to add a checktextbox procedure and implement number checking in the bankproc project for lab 12. Students are required to add the checktextbox procedure to their program, declare boolean variables for each textbox, and test the validity of user inputs before executing button actions. Additionally, students can add numeric checking to the computebalance procedure to handle negative balances and user inputs of 0 or negative numbers for the number of years.

Typology: Lab Reports

Pre 2010

Uploaded on 09/17/2009

koofers-user-ciu
koofers-user-ciu 🇺🇸

10 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download Lab 12: Adding TextBox and Number Checking Procedures in BankProc Project and more Lab Reports Information Technology in PDF only on Docsity! IST 256 Lab 12 – February 27, 2008 1. Continuing the Application with a General Procedure Open your BankProc project and complete it from Lab 11, if necessary. 2. Add TextBox Check Procedure Go to the class web page and get the TestProc3 program. Take the CheckTextBox procedure from that program and add it to your BankProc program. Put it at the top, either before or after your ComputeBalance procedure from the first part of the project. In each of your button procedures, you have two TextBoxes for input from the user. For each TextBox in each button procedure, declare a Boolean variable to be the result of checking that the TextBox has an entry. For example, in your Button1 procedure, you could declare: Dim isValid1 as Boolean Dim is Valid2 as Boolean Then before you get the current balance or the number of years from a TextBox, add two calls to the CheckTextBox procedure. One will test the current balance TextBox (whatever its name is, e.g. TextBox1) and give it the first Boolean variable isValid1. The second call to CheckTextBox will pass the number of years TextBox (whatever its name is, e.g. TextBox2) and give it the Boolean variable isValid2. Then add an If statement to test that the contents of these two TextBoxes are there: If ( isValid1 And isValid2 ) Then <put the rest of the Button actions here> End If Test your program. Make sure that it doesn’t get run-time errors if you don’t type anything into the TextBoxes before you click one of the buttons. 3. Add Number Checking If you have time, you can add some additional numeric checking to your program. In your ComputeBalance procedure, use an If test to see if the current balance starts out to be negative. If it is negative, then do not compute any interest and the new balance will just be the old current balance. Test what happens if the user types in 0 or a negative number for the number of years. Does this work o.k.? (I think it should, as long as your ComputeBalance procedure always assigns the new balance and the bonus message variables.)
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved