Department of Computer and Mathematical Sciences. Lab 7: Selection

Size: px
Start display at page:

Download "Department of Computer and Mathematical Sciences. Lab 7: Selection"

Transcription

1 Unit 2: Visual Basic.NET, pages 1 of 11 Department of Computer and Mathematical Sciences CS 1408 Intro to Computer Science with Visual Basic.NET 7 Lab 7: Selection Objectives: The main objective of this lab is to understand how and to use selection controls If-Thenand Select Case Structure in VB.NET. Task 1: Guessing Game The purpose of this task is to learn how to implement If-Then- statement. Statement of the Problem: Create a VB.NET application called Guessing Game that will generate a random number from between 0 and 100. The player/user will enter a guess number in the provided textbox, and then click on the Guess button. If the entered guess number is less than the generated random number, the message Your guess is too low. Try again. is displayed in the designated label. If the entered guess number is greater than the generated random number, the message Your guess is too high. Try again. is displayed. Otherwise, the message Congratulations!!! Your guess is correct. Click on the New Game button to start a new game. is displayed. The New Game button when clicked will start a new game with a new random number. The design/gui of application should look similar to the following figure: Activity 1.1: Create a new project for VB application called Lab7Tsk1 by first create a GUI with the following controls and property settings. Control Name Text ForeColor Font Size Others From1 Default Guessing Game Default None Size: 510, 290 Label1 Default GUESSING GAME Blue 12 Size: 265, 25 Label2 Default Enter Your Guess between 0 and 100: Blue 12 Size: 360, 30 Label3 DisplayLabel None Red 12 Size: 470, 50, BorderStyle: Fixed3D, BackColor: Yellow TextBox InputTextBox None Default 12 Size: 100, 30 Button1 GuessButton Guess Blue 12 Size: 120, 40 Button2 NewGameButton New Game Blue 12 Size: 120, 40 Button3 ExitButton Exit Blue 12 Size: 120, 40 Your GUI of Lab7Tsk1 VB application should look similar to Figure 1.

2 Unit 2: Visual Basic.NET, pages 2 of 11 Figure 1: Lab10Tsk1 Application at Design Time Now we are ready to add code to the Lab7Tsk1 VB application according to statement of the problem. From analyzing the problem, the Lab7Tsk1 VB application has four events and each event has the following actions to be performed: 1. While loading Guessing Game application/form at the start, it will randomly generate a number between 0 and 100 and display the message Start your first guess in the display label. 2. Guess button when clicked will determine whether the number from the InputTextBox is less than, greater than, or equal to the random number. o If it is less than, the message Your guess is too low. Try again. will appear in the display label. o If it is greater than, the message Your guess is too high. Try again. will appear in the display label. o If it is equal to, the message Congratulation!!! Your guess is correct. Click on the New Game button to start a new game. will appear in the display label. 3. New Game button when clicked will randomly generate a number from 0 to 100 and display the message Start your first guess. in the display label. It also clears the InputextBox. 4. Exit button when clicked will close the application. We can organize a chart describes actions to be performed by these four events as follows: Lab10Tsk1 Application Form1 Load Event Generate a random number between 0 and 100 Display the message Start your first guess in the display label. Guess Button Click Event If the guess is less than, the message Your guess is too low. Try again. will appear in the display label. If the guess is greater than, the message Your guess is too high. Try again. will appear in the display label. If the guess is equal to, the message Congratulation!!! Your guess is correct. Click on the New Game button to start a new game. will appear in the display label. New Game Button Click Event Generate a random number between 0 and 100 Display the message Start your first guess in display label. Clear the text in display label. Exit Button Click Event Close the application/window.

3 Lab 7: Selection, page 3 of 11 Activity 1.2: The first event, Form1 load, will load the application/form and while loading the application/form it will 1. Generate a random number between 0 and Display the message Start your first guess. in the display label. This event is called load and the object is being loaded is Form1. The code to generate a random number between 0 and 100 is as follows: REM Initialize random-number generator. Randomize() REM Generate random value between 0 and 100. RandomNumber = CInt(Int((100 * Rnd()))) The code to display the message Start your first guess. in the display label (DiasplayLabel) is as follows: REM Display the message the starting of a game DisplayLabel.Text = "Start your first guess." Insert the above code in the appropriate event procedure that will randomly generate a number from 0 to 100 and display the message Start your first guess in the display label when the form Guessing Game is loaded. Activity 1.3: The New Game Button Click event will perform the following actions: Generate a random number between 0 and 100 Display the message Start your first guess in display label. Clear the text in display label. The code to generate a random number between 0 and 100 is as follows: REM Initialize random-number generator. Randomize() REM Generate random value between 0 and 9. RandomNumber = CInt(Int((100 * Rnd()))) The code to display the message Start your first guess in the display label (DiasplayLabel) is as follows: REM Display the message the starting of a new game DisplayLabel.Text = "Start your first guess." The code to clear the text in the display label (DisplayLabel) is as follows: REM Clear the input in the textbox InputTextBox.Text = "" Insert the above code in the appropriate event procedure that will randomly regenerate a number from 0 to 100, display the message Start your first guess in the display label and clear the InputextBox when the New Game button is clicked. Activity 1.4: The Guess Button Click Event will perform the following actions: If the guess is less than, the message Your guess is too low. Try again. will appear in the display label. If the guess is greater than, the message Your guess is too high. Try again. will appear in the display label. If the guess is equal to, the message Congratulation!!! Your guess is correct. Click on the New Game button to start a new game. will appear in the display label. The code to perform the above task is as follows: REM Assign the value from InputTextBox to the variable Guess. Guess = Val(InputTextBox.Text) This statement initializes Guess to the value from the textbox.

4 Unit 2: Visual Basic.NET, pages 4 of 11 REM Set the focus to InputTextBox and highlight the text in the textbox. InputTextBox.Focus() InputTextBox.SelectAll() These statements set focus and highlight the text in the REM determine whether the Guess is high, low, or correct. If Guess > RandomNumber Then DisplayLabel.Text = "Your guess is too high. Try again." This is a nested if-then-else statement to determine whether If Guess < RandomNumber Then Guess is less than, greater than or equal to RandomNumber. DisplayLabel.Text = "Your guess is too low. Try again." DisplayLabel.Text = "Congratulation!!! Your guess is correct. Click on the New Game button to start a new game." Insert the above code in the appropriate event procedure that will determine whether the number from the InputTextBox is less than, greater than, or equal to the random number and then display appropriate message in the display label when the Guess button is clicked. Activity 1.5: Modified the application Lab7Tsk1 from Activity 1.4 using If-Then- statement such that it will limit the users to only 4 guesses. The appearance of application Lab7Tsk1 at initial run time should look like Figure 2 with the message "You are limited to the maximum of 4 guesses. Start your first guess." in the display label. If the user makes more than 4 guesses, the display should show "Sorry!!! You went over the limit of guesses. Click on the New Game button to start a new game." as shown in Figure 2 and 3. Figure 2: Lab7Tsk1 Application at Initial Run Time Figure 3: Lab7Tsk1 Application When It is Over 4 with 4 guesses limit guesses Hint: use the following declaration of variables in your modification. Const MaxTries As Byte = 4 Dim Tries As Byte You can use the variable Tries to keep track of how many guesses the user has made. Tries must be initialized to 0 when the application is initially loaded and when the New Game button is clicked. Activity 1.6: Modified the application Lab7Tsk1 from Activity 1.5 such that it will limit the users to only 8 guesses. Task 2: Numbers Game The purpose of this task is to learn how to implement nested If-Then- statement. Activity 2.1: Study the following code. This code is a nested If-Then- statement. It will display either The First Message., The Second Message., The Third Message., The Fourth Message., or The Last Message. depends on the values of Integer1 and/or Integer2. If (Integer1 < 0) Or (Integer2 < 0) Then DisplayLabel.Text = "The First Message." Determine where to put these declarations such that more than one events procedure can access these variables.

5 Lab 7: Selection, page 5 of 11 If (Integer2 Mod 2) = 0 Then DisplayLabel.Text = "The Second Message." If (Integer1 \ 3 = 0) And (Integer2 >= 5) Then DisplayLabel.Text = "The Third Message." If Integer2 <> 5 Then DisplayLabel.Text = "The Fourth Message." DisplayLabel.Text = "The Last Message." Complete the following table by filling in with appropriate values of Integer1 and Integer2. Code Integer1 Integer2 Message If (Integer1 < 0) Or (Integer2 < 0) Then DisplayLabel.Text = "The First Message." If (Integer2 Mod 2) = 0 Then DisplayLabel.Text = "The Second Message." If (Integer1\3 = 0) And (Integer2 >= 5) Then DisplayLabel.Text = "The Third Message." If Integer2 <> 5 Then DisplayLabel.Text = "The Fourth Message." DisplayLabel.Text = "The Last Message." Statement of the Problem: Create a VB.NET application called Numbers Game that will list a code of nested If-Then- statement in a list box. The player/user will determine a pair of integers to be entered for each textbox so that when the Enter button is clicked the appropriate message will be displayed in a provided label. The design/gui of application should look similar to the following figure: Activity 2.2: Create a new project for VB application called Lab7Tsk2 by first create a GUI with the following controls and property settings. The First Message. The Second Message. The Third Message. The Fourth Message. The Last Message. Control Name Text ForeColor Font Size Others From1 Default Numbers Game Default None Size: 570, 520 Label1 Default NUMBERS GAME Blue 12 Size: 270, 30 Label2 Default Code Given: Blue 12 Size: 360, 30 Label3 Default Determine two integers that will Blue 12 Size: 510, 30 output each message. Label4 Default Integer 1 Blue 12 Size: 100, 25 Label5 Default Integer 2 Blue 12 Size: 100, 25 Label6 Default Message: Blue 12 Size: 100, 25 Label7 DisplayLabel None Red 12 Size: 410, 30, BorderStyle: Fixed3D, BackColor: Yellow TextBox1 Integer1TextBox None Default 12 Size: 80, 30 TextBox2 Integer2TextBox None Default 12 Size: 80, 30 Button EnterButton Enter Blue 12 Size: 100, 30 ListBox CodeListBox None Default 12 Size: 540, 230 Your GUI of Lab7Tsk2 VB application should look similar to Figure 4.

6 Unit 2: Visual Basic.NET, pages 6 of 11 Figure 4: Lab7Tsk2 Application at Design Time Now we are ready to add code to the Lab7Tsk2 VB application according to statement of the problem. From analyzing the problem, the Lab7Tsk2 VB application has two events and each event has the following actions to be performed: 1. While loading Numbers Game application/form at the start, it will display the code of the nested If-Then- statement in the ListBox as shown in the right figure. 2. Enter button when clicked will Retrieve an integer from each textbox, Integer1 and Integer2 Determine an appropriate message to be displayed according to the two integers: If Integer1 is less than 0 or Integer2 is less than 0, then display the message The First Message. ; otherwise If Integer2 Mod 2 is 0, then display the message The Second Message. ; otherwise If Integer1 divide by 3 is 0 and Integer2 is greater than or equal to 5, then display the message The Third Message. ; otherwise If Integer2 is not equal to 5, then display the message The Fourth Message. ; otherwise, display the message The Last Message. We can organize a chart describes actions to be performed by these two events as follows: Lab9Tsk2 Application Form1 Load Event Display the code of the nested If-Then- statement in the ListBox. Enter Button Click Event Retrieve an integer from each textbox, Integer1 and Integer2 Determine an appropriate message to be displayed according to the two integers: If Integer1 is less than 0 or Integer2 is less than 0, then display the message The First Message. ; otherwise If Integer2 Mod 2 is 0, then display the message The Second Message. ; otherwise If Integer1 divide by 3 is 0 and Integer2 is greater than or equal to 5, then display the message The Third Message. ; otherwise If Integer2 is not equal to 5, then display the message The Fourth Message. ; otherwise, display the message The Last Message.

7 Lab 7: Selection, page 7 of 11 Activity 2.3: The first event, Form1 load, will load the application/form and while loading the application/form it will Display the code of the nested If-Then- statement in the ListBox. The code to display the nested If-Then- statement in the ListBox is: REM Display the code in the ListBox CodeListBox.Items.Add("If (Integer1 < 0) Or (Integer2 < 0) Then") CodeListBox.Items.Add(" DisplayLabel.Text = ""The First Message.""") CodeListBox.Items.Add("If (Integer2 Mod 2) = 0 Then") CodeListBox.Items.Add(" DisplayLabel.Text = ""The Second Message.""") CodeListBox.Items.Add("If (Integer1 \ 3 = 0) And (Integer2 >= 5) Then") CodeListBox.Items.Add(" DisplayLabel.Text = ""The Third Message.""") CodeListBox.Items.Add("If Integer2 <> 5 Then") CodeListBox.Items.Add(" DisplayLabel.Text = ""The Fourth Message.""") CodeListBox.Items.Add("") CodeListBox.Items.Add(" DisplayLabel.Text = ""The Last Message.""") CodeListBox.Items.Add("") Insert the above code in an appropriate event procedure that will display the given nested If- Then- statement in the ListBox when the form Numbers Game is loaded. Activity 2.4: The Enter Button Click event will perform the following actions: Retrieve an integer from each textbox, Integer1 and Integer2 Determine an appropriate message to be displayed according to the two integers: If Integer1 is less than 0 or Integer2 is less than 0, then display the message The First Message. ; otherwise If Integer2 Mod 2 is 0, then display the message The Second Message. ; otherwise If Integer1 divide by 3 is 0 and Integer2 is greater than or equal to 5, then display the message The Third Message. ; otherwise If Integer2 is not equal to 5, then display the message The Fourth Message. ; otherwise, display the message The Last Message. The code to perform the above actions is as follows: Dim Integer1, Integer2 As Integer REM Assign values from Textboxes to Integer1 and Integer2 Integer1 = Val(Integer1TextBox.Text) Integer2 = Val(Integer2TextBox.Text) REM Nested if-then-else If (Integer1 < 0) Or (Integer2 < 0) Then DisplayLabel.Text = "The First Message." If (Integer2 Mod 2) = 0 Then DisplayLabel.Text = "The Second Message." If (Integer1 \ 3 = 0) And (Integer2 >= 5) Then DisplayLabel.Text = "The Third Message." If Integer2 <> 5 Then DisplayLabel.Text = "The Fourth Message." DisplayLabel.Text = "The Last Message." REM Set focus to Integer1TextBox Integer1TextBox.Focus() Integer1TextBox.SelectAll() End Sub

8 Unit 2: Visual Basic.NET, pages 8 of 11 Insert the above code in the appropriate event procedure that will display a message in the display label when the Enter button is clicked. Activity 2.5: Run the application Lab7Tsk2 and verify your answer in Activity 2.1. Code Integer1 Integer2 Message If (Integer1 < 0) Or (Integer2 < 0) Then DisplayLabel.Text = "The First Message." If (Integer2 Mod 2) = 0 Then DisplayLabel.Text = "The Second Message." If (Integer1\3 = 0) And (Integer2 >= 5) Then DisplayLabel.Text = "The Third Message." If Integer2 <> 5 Then DisplayLabel.Text = "The Fourth Message." DisplayLabel.Text = "The Last Message." The First Message. The Second Message. The Third Message. The Fourth Message. The Last Message. Task 3: Tax Rate The purpose of this task is to learn how to implement Select-Case statement. The Select-Case structure is an alternative to the If-Then-If structure. The syntax of the Select-Case construct is as follows: Select Case expression Case value_1 statement(s) Case value_2 statement(s)... Case value_n statement(s) Case statement(s) End Select The following is the same example where one using If-Then-If structure and the other using Select-Case structure. The Select-Case structure is more organized and is easy to understand. If (creditsearned >= 90) Then DisplayLabel.Text = SENIOR STATUS If (creditsearned >= 60) Then DisplayLabel.Text = JUNIOR STATUS IF (creditsearned >= 30) Then DisplayLabel.Text = SOPHOMORE STATUS DisplayLabel.Text = FRESHMAN STATUS Statement of the Problem: Create a VB.NET application called 2005 Tax Rate that will estimate income tax paid for either single or married according to their income. The design/gui of application should look similar to the following figure: Activity 3.1: Create a VB application called Lab7Tsk3 by first create a GUI with the following controls and property settings. Select Case creditsearned Case Is >= 90 Is refer to creditsearned DisplayLabel.Text = SENIOR STATUS Case 60 to 89 DisplayLabel.Text = JUNIOR STATUS Case 30 to 59 DisplayLabel.Text = SOPHOMORE STATUS Case DisplayLabel.Text = FRESHMAN STATUS End Select

9 Lab 7: Selection, page 9 of 11 Control Name Text ForeColor Font Size Others From1 Default 2005 Tax Rate Default None Size: 510, 290 Label1 Default 2005 ESTIMATED TAX RATE Blue 12 Size: 300, 30, Bold: True Label2 Default Enter Your Income: Blue 12 Size: 190, 30 Label3 Default Estimated Tax Paid: Blue 12 Size: 190, 30 Size: 250, 30, BorderStyle: Label4 DisplayLabel None Red 12 Fixed3D, BackColor: Yellow TextBox IncomeTextBox None Default 12 Size: 190, 30 RadioButton1 SingleRadioButton Single Blue 12 Size: 90, 30, Checked: True RadioButton2 MarriedRadioButton Married Filing Jointly Blue 12 Size: 220, 30 Button EnterButton Enter Blue 12 Size: 120, 40 Your GUI of Lab7Tsk3 VB application should look similar to Figure 5. Figure 5: Lab7Tsk3 Application at Design Time According to the following 2005 Tax Rate from Internal Revenue Service Web site, the estimated income tax paid can be computed using the tables given below. One is for single and the other is for married couple filing joint return Tax Rate Schedules Note: These tax rate schedules are provided so that you can compute your estimated tax for To compute your actual income tax, please see the instructions for 2005 Form 1040, 1040A, or 1040EZ as appropriate when they are available. Schedule X Single If taxable income is over-- But not over-- The tax is: $0 $7,300 10% of the amount over $0 $7,300 $29,700 $730 plus 15% of the amount over 7,300 $29,700 $71,950 $4, plus 25% of the amount over 29,700 $71,950 $150,150 $14, plus 28% of the amount over 71,950 $150,150 $326,450 $36, plus 33% of the amount over 150,150 $326,450 no limit $94, plus 35% of the amount over 326,450 Schedule Y-1 Married Filing Jointly or Qualifying Widow(er) If taxable income is over-- But not over-- The tax is: $0 $14,600 10% of the amount over $0 $14,600 $59,400 $1, plus 15% of the amount over 14,600 $59,400 $119,950 $8,180 plus 25% of the amount over 59,400 $119,950 $182,800 $23, plus 28% of the amount over 119,950 $182,800 $326,450 $40, plus 33% of the amount over 182,800 $326,450 no limit $88, plus 35% of the amount over 326,450 Now we are ready to add code to the Lab7Tsk3 VB application according to statement of the problem. From analyzing the problem, the Lab7Tsk2 VB application has only one event and this event has the following actions to be performed: Enter button when clicked will Retrieve the value from the IncomeTextBox

10 Unit 2: Visual Basic.NET, pages 10 of 11 Compute the estimated tax paid based on the entered valued in the textbox and whether SingleRadioButton or MarriedRadioButton is selected. Display estimated tax paid in the display label. We can organize a chart describes actions to be performed by this event as follows: Lab9Tsk3 Application Enter Button Click Event Retrieve the value from the IncomeTextBox Compute the estimated tax paid based on the entered valued in the textbox and whether SingleRadioButton or MarriedRadioButton is selected. Display estimated tax paid in the display label. Activity 3.2: The Enter button click event will perform the following actions: Retrieve the value from the IncomeTextBox Compute the estimated tax paid based on the entered valued in the textbox and whether SingleRadioButton or MarriedRadioButton is selected. Display estimated tax paid in the display label. The code to retrieve the value from the IncomeTextBox is as follws: Dim Income As Integer Dim TaxPaid As Double REM Assign Income to the number from IncomeTextBox Income = IncomeTextBox.Text The code to Compute the estimated tax paid based on the entered valued in the textbox and whether SingleRadioButton or MarriedRadioButton is selected. REM Check whether it is single filing or marries filing jointly If SingleRadioButton.Checked Then REM Compute the tax paid for single If Income <= 7300 Then TaxPaid = 0.1 * Income If Income > 7300 And Income <= Then TaxPaid = 0.15 * (Income 7300) If Income > And Income <= Then TaxPaid = 0.25 * (Income 29700) If Income > And Income <= Then TaxPaid = 0.28 * (Income 71950) If Income > And Income <= Then TaxPaid = 0.33 * (Income ) TaxPaid = 0.35 * (Income ) REM Compute the tax paid for single If Income <= Then TaxPaid = 0.1 * Income If Income > And Income <= Then TaxPaid = 0.15 * (Income 14600) If Income > And Income <= Then TaxPaid = 0.25 * (Income 59400) If Income > And Income <= Then TaxPaid = 0.28 * (Income ) If Income > And Income <= Then TaxPaid = 0.33 * (Income ) TaxPaid = 0.35 * (Income ) The code to display estimated tax paid in the display label. REM Display tax paid DisplayLabel.Text = FormatCurrency(TaxPaid)

11 Lab 7: Selection, page 11 of 11 Insert the above code in the appropriate event procedure that will display a message in the display label when the Enter button is clicked. Activity 3.3: Replace only nested If-Then-If statements (there are two of them) in Activity 3.2 with Select-Case statements.

Data Types. Strings Variables Declaration Statements Named Constant Assignment Statements Intrinsic (Built-in) Functions

Data Types. Strings Variables Declaration Statements Named Constant Assignment Statements Intrinsic (Built-in) Functions Data and Operations Outline Data Types Arithmetic Operations Strings Variables Declaration Statements Named Constant Assignment Statements Intrinsic (Built-in) Functions Data and Operations 1 Data and

More information

Fast Food Store Group Boxes and Other User Controls

Fast Food Store Group Boxes and Other User Controls VISUAL BASIC Fast Food Store Group Boxes and Other User Controls Copyright 2014 Dan McElroy Sample Program Execution The customer receipt is updated each time another selection is made and the Enter button

More information

Departme and. Computer. CS Intro to. Science with. Objectives: The main. for a problem. of Programming. Syntax Set of rules Similar to.

Departme and. Computer. CS Intro to. Science with. Objectives: The main. for a problem. of Programming. Syntax Set of rules Similar to. _ Unit 2: Visual Basic.NET, pages 1 of 13 Departme ent of Computer and Mathematical Sciences CS 1408 Intro to Computer Science with Visual Basic.NET 4 Lab 4: Getting Started with Visual Basic.NET Programming

More information

Data and Operations. Outline

Data and Operations. Outline Data and Operations Data and Operations 1 Outline Data Types Arithmetic Operations Strings Variables Declaration Statements Named Constant Assignment Statements Intrinsic (Built-in) Functions Data and

More information

Lab 3 The High-Low Game

Lab 3 The High-Low Game Lab 3 The High-Low Game LAB GOALS To develop a simple windows-based game named High-Low using VB.Net. You will use: Buttons, Textboxes, Labels, Dim, integer, arithmetic operations, conditionals [if-then-else],

More information

Visual Basic.NET. 1. Which language is not a true object-oriented programming language?

Visual Basic.NET. 1. Which language is not a true object-oriented programming language? Visual Basic.NET Objective Type Questions 1. Which language is not a true object-oriented programming language? a.) VB.NET b.) VB 6 c.) C++ d.) Java Answer: b 2. A GUI: a.) uses buttons, menus, and icons.

More information

1. What is the definition of a problem? 2. How to solve problems? 3. What is meant by Algorithm? 4. What is a Program testing? 5. What is Flowchart?

1. What is the definition of a problem? 2. How to solve problems? 3. What is meant by Algorithm? 4. What is a Program testing? 5. What is Flowchart? 1. What is the definition of a problem? 2. How to solve problems? 3. What is meant by Algorithm? 4. What is a Program testing? 5. What is Flowchart? 6. Define Visual Basic.NET? 7. Define programming language?

More information

Flow of Control Branching 2. Cheng, Wei COMP May 19, Title

Flow of Control Branching 2. Cheng, Wei COMP May 19, Title Flow of Control Branching 2 Cheng, Wei COMP110-001 May 19, 2014 Title Review of Previous Lecture If else Q1: Write a small program that Reads an integer from user Prints Even if the integer is even Otherwise,

More information

First Visual Basic Lab Paycheck-V1.0

First Visual Basic Lab Paycheck-V1.0 VISUAL BASIC LAB ASSIGNMENT #1 First Visual Basic Lab Paycheck-V1.0 Copyright 2013 Dan McElroy Paycheck-V1.0 The purpose of this lab assignment is to enter a Visual Basic project into Visual Studio and

More information

Download the files from you will use these files to finish the following exercises.

Download the files from  you will use these files to finish the following exercises. Exercise 6 Download the files from http://www.peter-lo.com/teaching/x4-xt-cdp-0071-a/source6.zip, you will use these files to finish the following exercises. 1. This exercise will guide you how to create

More information

3. The first step in the planning phase of a programming solution is to sketch the user interface.

3. The first step in the planning phase of a programming solution is to sketch the user interface. Chapter 2: Designing Applications TRUE/FALSE 1. For an application to fulfill the wants and needs of the user, it is essential for the programmer to plan the application jointly with the user. ANS: T PTS:

More information

1. Arithmetic Calculation

1. Arithmetic Calculation 1. Arithmetic Calculation 1. Open the Microsoft Visual Studio and start a new Visual Basic Project named as ArithmeticExpression. From the Toolbox, drag two Textbox controls and one Button control onto

More information

Chapter 3 Selections. Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved.

Chapter 3 Selections. Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. Chapter 3 Selections Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807 1 Motivations If you assigned a negative value for radius

More information

In this lab, you will learn more about selection statements. You will get familiar to

In this lab, you will learn more about selection statements. You will get familiar to Objective: In this lab, you will learn more about selection statements. You will get familiar to nested if and switch statements. Nested if Statements: When you use if or if...else statement, you can write

More information

Lab 4: Introduction to Programming

Lab 4: Introduction to Programming _ Unit 2: Programming in C++, pages 1 of 9 Department of Computer and Mathematical Sciences CS 1410 Intro to Computer Science with C++ 4 Lab 4: Introduction to Programming Objectives: The main objective

More information

RANDOM NUMBER GAME PROJECT

RANDOM NUMBER GAME PROJECT Random Number Game RANDOM NUMBER GAME - Now it is time to put all your new knowledge to the test. You are going to build a random number game. - The game needs to generate a random number between 1 and

More information

Motivations. Chapter 3: Selections and Conditionals. Relational Operators 8/31/18. Objectives. Problem: A Simple Math Learning Tool

Motivations. Chapter 3: Selections and Conditionals. Relational Operators 8/31/18. Objectives. Problem: A Simple Math Learning Tool Chapter 3: Selections and Conditionals CS1: Java Programming Colorado State University Motivations If you assigned a negative value for radius in Listing 2.2, ComputeAreaWithConsoleInput.java, the program

More information

Logic & program control part 3: Compound selection structures

Logic & program control part 3: Compound selection structures Logic & program control part 3: Compound selection structures Multi-way selection Many algorithms involve several possible pathways to a solution A simple if/else structure provides two alternate paths;

More information

Visual Basic Course Pack

Visual Basic Course Pack Santa Monica College Computer Science 3 Visual Basic Course Pack Introduction VB.NET, short for Visual Basic.NET is a language that was first introduced by Microsoft in 1987. It has gone through many changes

More information

Level 3 Computing Year 1 Lecturer: Phil Smith

Level 3 Computing Year 1 Lecturer: Phil Smith Level 3 Computing Year 1 Lecturer: Phil Smith Previously.. We looked at forms and controls. The event loop cycle. Triggers. Event handlers. Objectives for today.. 1. To gain knowledge and understanding

More information

Disclaimer. Trademarks. Liability

Disclaimer. Trademarks. Liability Disclaimer II Visual Basic 2010 Made Easy- A complete tutorial for beginners is an independent publication and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by Microsoft

More information

Dive Into Visual C# 2010 Express

Dive Into Visual C# 2010 Express Dive Into Visual C# 2010 Express 2 Seeing is believing. Proverb Form ever follows function. Louis Henri Sullivan Intelligence is the faculty of making artificial objects, especially tools to make tools.

More information

Tutorial OPENRULES. Preparing a Tax Return Using OpenRules Dialog (Dialog1040EZ) Open Source Business Decision Management System. Release 6.

Tutorial OPENRULES. Preparing a Tax Return Using OpenRules Dialog (Dialog1040EZ) Open Source Business Decision Management System. Release 6. OPENRULES Open Source Business Decision Management System Release 6.1 Preparing a Tax Return Using OpenRules Dialog (Dialog1040EZ) Tutorial OpenRules, Inc. www.openrules.com August-2011 Table of Content

More information

Start Visual Basic. Session 1. The User Interface Form (I/II) The Visual Basic Programming Environment. The Tool Box (I/II)

Start Visual Basic. Session 1. The User Interface Form (I/II) The Visual Basic Programming Environment. The Tool Box (I/II) Session 1 Start Visual Basic Use the Visual Basic programming environment Understand Essential Visual Basic menu commands and programming procedure Change Property setting Use Online Help and Exit Visual

More information

In this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics.

In this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics. Additional Controls, Scope, Random Numbers, and Graphics CS109 In this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics. Combo

More information

LAB 4.1 Relational Operators and the if Statement

LAB 4.1 Relational Operators and the if Statement LAB 4.1 Relational Operators and the if Statement // This program tests whether or not an initialized value of num2 // is equal to a value of num1 input by the user. int main( ) int num1, // num1 is not

More information

Selections. CSE 114, Computer Science 1 Stony Brook University

Selections. CSE 114, Computer Science 1 Stony Brook University Selections CSE 114, Computer Science 1 Stony Brook University http://www.cs.stonybrook.edu/~cse114 1 Motivation If you assigned a negative value for radius in ComputeArea.java, then you don't want the

More information

Controls. By the end of this chapter, student will be able to:

Controls. By the end of this chapter, student will be able to: Controls By the end of this chapter, student will be able to: Recognize the (Properties Window) Adjust the properties assigned to Controls Choose the appropriate Property Choose the proper value for the

More information

2. A GUI A. uses buttons, menus, and icons B. should be easy for a user to manipulate C. both (a) and (b) D. stands for Graphic Use Interaction

2. A GUI A. uses buttons, menus, and icons B. should be easy for a user to manipulate C. both (a) and (b) D. stands for Graphic Use Interaction 1. Which language is not a true object-oriented programming language? A. VB 6 B. VB.NET C. JAVA D. C++ 2. A GUI A. uses buttons, menus, and icons B. should be easy for a user to manipulate C. both (a)

More information

Final Examination Semester 2 / Year 2010

Final Examination Semester 2 / Year 2010 Southern College Kolej Selatan 南方学院 Final Examination Semester 2 / Year 2010 COURSE : VISUAL BASIC.NET COURSE CODE : PROG2024 TIME : 2 1/2 HOURS DEPARTMENT : COMPUTER SCIENCE LECTURER : LIM PEI GEOK Student

More information

COMP Flow of Control: Branching 2. Yi Hong May 19, 2015

COMP Flow of Control: Branching 2. Yi Hong May 19, 2015 COMP 110-001 Flow of Control: Branching 2 Yi Hong May 19, 2015 Review if else Q1: Write a program that Reads an integer from user Prints Even if the integer is even Otherwise, prints Odd Boolean expression

More information

Revision for Final Examination (Second Semester) Grade 9

Revision for Final Examination (Second Semester) Grade 9 Revision for Final Examination (Second Semester) Grade 9 Name: Date: Part 1: Answer the questions given below based on your knowledge about Visual Basic 2008: Question 1 What is the benefit of using Visual

More information

VB FUNCTIONS AND OPERATORS

VB FUNCTIONS AND OPERATORS VB FUNCTIONS AND OPERATORS In der to compute inputs from users and generate results, we need to use various mathematical operats. In Visual Basic, other than the addition (+) and subtraction (-), the symbols

More information

Overview About KBasic

Overview About KBasic Overview About KBasic The following chapter has been used from Wikipedia entry about BASIC and is licensed under the GNU Free Documentation License. Table of Contents Object-Oriented...2 Event-Driven...2

More information

B.V Patel Institute of BMC & IT, UTU

B.V Patel Institute of BMC & IT, UTU Corse Code and Corse Name: 030010401-GUI Programming Unit 1. Introduction to.net Framework Short Questions 1. What is.net Framework? 2. What is VB.NET? 3. Which are the main components of.net Framework?

More information

Introductionto the Visual Basic Express 2008 IDE

Introductionto the Visual Basic Express 2008 IDE 2 Seeing is believing. Proverb Form ever follows function. Louis Henri Sullivan Intelligence is the faculty of making artificial objects, especially tools to make tools. Henri-Louis Bergson Introductionto

More information

Programming with visual Basic:

Programming with visual Basic: Programming with visual Basic: 1-Introdution to Visual Basics 2-Forms and Control tools. 3-Project explorer, properties and events. 4-make project, save it and its applications. 5- Files projects and exercises.

More information

CS1110. Fall Assignment A4. Alternative Minimum Tax. Due on the CMS, Oct. 16, 11:59pm 1

CS1110. Fall Assignment A4. Alternative Minimum Tax. Due on the CMS, Oct. 16, 11:59pm 1 CS1110. Fall 2010. Assignment A4. Alternative Minimum Tax. Due on the CMS, Oct. 16, 11:59pm 1 Introduction This assignment gives you practice writing sequences of statements using assignments, method calls,

More information

A Complete Tutorial for Beginners LIEW VOON KIONG

A Complete Tutorial for Beginners LIEW VOON KIONG I A Complete Tutorial for Beginners LIEW VOON KIONG Disclaimer II Visual Basic 2008 Made Easy- A complete tutorial for beginners is an independent publication and is not affiliated with, nor has it been

More information

Program Example 15 String Handling 2

Program Example 15 String Handling 2 Program Example 15 String Handling 2 Objectives Program Purpose Count the number of words, spaces and alphabetic characters in a sentence. Display the tally of letters Learning Goals To develop string

More information

Critical Thinking Assignment #6: Java Program #6 of 6 (70 Points)

Critical Thinking Assignment #6: Java Program #6 of 6 (70 Points) Critical Thinking Assignment #6: Java Program #6 of 6 (70 Points) Java Interactive GUI Application for Number Guessing with Colored Hints (based on Module 7 material) 1) Develop a Java application that

More information

Exercise 1 Using Boolean variables, incorporating JavaScript code into your HTML webpage and using the document object

Exercise 1 Using Boolean variables, incorporating JavaScript code into your HTML webpage and using the document object CS1046 Lab 5 Timing: This lab should take you approximately 2 hours. Objectives: By the end of this lab you should be able to: Recognize a Boolean variable and identify the two values it can take Calculate

More information

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net UNIT 1 Introduction to Microsoft.NET framework and Basics of VB.Net 1 SYLLABUS 1.1 Overview of Microsoft.NET Framework 1.2 The.NET Framework components 1.3 The Common Language Runtime (CLR) Environment

More information

IT3101 -Rapid Application Development Second Year- First Semester. Practical 01. Visual Basic.NET Environment.

IT3101 -Rapid Application Development Second Year- First Semester. Practical 01. Visual Basic.NET Environment. IT3101 -Rapid Application Development Second Year- First Semester Practical 01 Visual Basic.NET Environment. Main Area Menu bar Tool bar Run button Solution Explorer Toolbox Properties Window Q1) Creating

More information

Unit 6 - Software Design and Development LESSON 3 KEY FEATURES

Unit 6 - Software Design and Development LESSON 3 KEY FEATURES Unit 6 - Software Design and Development LESSON 3 KEY FEATURES Last session 1. Language generations. 2. Reasons why languages are used by organisations. 1. Proprietary or open source. 2. Features and tools.

More information

Balloon Tooltips.NET by SkySof Software Inc. last updated: 10/18/05

Balloon Tooltips.NET by SkySof Software Inc. last updated: 10/18/05 Balloon Tooltips.NET by SkySof Software Inc. last updated: 10/18/05 Balloon Tooltips.NET is a.net component written in Visual Basic.NET which allows you to create cool, talking, customized tooltips for

More information

LAB 5: SELECTION STATEMENTS

LAB 5: SELECTION STATEMENTS Statement Purpose: The purpose of this lab is to familiarize students with Conditional statements and explain how to control the sequence of statement execution, depending on the value of an expression

More information

Introduction. Create a New Project. Create the Main Form. Assignment 1 Lights Out! in C# GUI Programming 10 points

Introduction. Create a New Project. Create the Main Form. Assignment 1 Lights Out! in C# GUI Programming 10 points Assignment 1 Lights Out! in C# GUI Programming 10 points Introduction In this lab you will create a simple C# application with a menu, some buttons, and an About dialog box. You will learn how to create

More information

IT 1033: Fundamentals of Programming Loops

IT 1033: Fundamentals of Programming Loops IT 1033: Fundamentals of Programming Loops Budditha Hettige Department of Computer Science Repetitions: Loops A loop is a sequence of instruction s that is continually repeated until a certain condition

More information

COMP 110 Introduction to Programming. What did we discuss?

COMP 110 Introduction to Programming. What did we discuss? COMP 110 Introduction to Programming Fall 2015 Time: TR 9:30 10:45 Room: AR 121 (Hanes Art Center) Jay Aikat FB 314, aikat@cs.unc.edu Previous Class What did we discuss? COMP 110 Fall 2015 2 1 Today Announcements

More information

Intro to Event-Driven Programming

Intro to Event-Driven Programming Unit 5. Lessons 1 to 5 AP CS P We roughly follow the outline of assignment in code.org s unit 5. This is a continuation of the work we started in code.org s unit 3. Occasionally I will ask you to do additional

More information

Chapter 4 : Selection (pp )

Chapter 4 : Selection (pp ) Page 1 of 40 Printer Friendly Version User Name: Stephen Castleberry email Id: scastleberry@rivercityscience.org Book: A First Book of C++ 2007 Cengage Learning Inc. All rights reserved. No part of this

More information

Full file at https://fratstock.eu Programming in Visual Basic 2010

Full file at https://fratstock.eu Programming in Visual Basic 2010 OBJECTIVES: Chapter 2 User Interface Design Upon completion of this chapter, your students will be able to 1. Use text boxes, masked text boxes, rich text boxes, group boxes, check boxes, radio buttons,

More information

Full file at

Full file at T U T O R I A L 3 Objectives In this tutorial, you will learn to: Set the text in the Form s title bar. Change the Form s background color. Place a Label control on the Form. Display text in a Label control.

More information

Ms. Payne, WCSS. This is very much like asking a question, and having a yes/no answer (also known a true/false). The general structure for this is:

Ms. Payne, WCSS. This is very much like asking a question, and having a yes/no answer (also known a true/false). The general structure for this is: The Decision Structure The repetition (looping) structure discussed previously is a very important structure because it allows the programmer to instruct the computer to do something more than once. The

More information

Disclaimer. Trademarks. Liability

Disclaimer. Trademarks. Liability Disclaimer II Visual Basic 2010 Made Easy- A complete tutorial for beginners is an independent publication and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by Microsoft

More information

Las Vegas, Nevada, December 3 6, Kevin Vandecar. Speaker Name:

Las Vegas, Nevada, December 3 6, Kevin Vandecar. Speaker Name: Las Vegas, Nevada, December 3 6, 2002 Speaker Name: Kevin Vandecar Course Title: Introduction to Visual Basic Course ID: CP11-3 Session Overview: Introduction to Visual Basic programming is a beginning

More information

Computer Engineering 1 (1E3)

Computer Engineering 1 (1E3) Faculty of Engineering, Mathematics and Science School of Computer Science & Statistics Engineering Trinity Term 2017 Junior Freshman Examinations Computer Engineering 1 (1E3) DD MMM YYYY Venue 14.00 16.00

More information

Flow of programming execution control is sequential unless a control structure is used to change that there are 2 general types of

Flow of programming execution control is sequential unless a control structure is used to change that there are 2 general types of Selection Control Structures Outline Boolean Expressions Boolean Operators Relational Operators if statement CS 1410 Comp Sci with C++ Selection Control Structures 1 CS 1410 Comp Sci with C++ Selection

More information

Unit 6 - Software Design and Development LESSON 3 KEY FEATURES

Unit 6 - Software Design and Development LESSON 3 KEY FEATURES Unit 6 - Software Design and Development LESSON 3 KEY FEATURES Last session 1. Language generations. 2. Reasons why languages are used by organisations. 1. Proprietary or open source. 2. Features and tools.

More information

Decision Structures. Start. Do I have a test in morning? Study for test. Watch TV tonight. Stop

Decision Structures. Start. Do I have a test in morning? Study for test. Watch TV tonight. Stop Decision Structures In the programs created thus far, Visual Basic reads and processes each of the procedure instructions in turn, one after the other. This is known as sequential processing or as the

More information

COMP Introduction to Programming If-Else Statement, Switch Statement and Loops

COMP Introduction to Programming If-Else Statement, Switch Statement and Loops COMP 110-003 Introduction to Programming If-Else Statement, Switch Statement and Loops February 5, 2013 Haohan Li TR 11:00 12:15, SN 011 Spring 2013 Announcement Office hour is permanently changed Wednesday,

More information

1. Which of the following is the correct expression of character 4? a. 4 b. "4" c. '\0004' d. '4'

1. Which of the following is the correct expression of character 4? a. 4 b. 4 c. '\0004' d. '4' Practice questions: 1. Which of the following is the correct expression of character 4? a. 4 b. "4" c. '\0004' d. '4' 2. Will System.out.println((char)4) display 4? a. Yes b. No 3. The expression "Java

More information

Java Outline (Upto Exam 2)

Java Outline (Upto Exam 2) Java Outline (Upto Exam 2) Part 4 IF s (Branches) and Loops Chapter 12/13 (The if Statement) Hand in Program Assignment#1 (12 marks): Create a program called Ifs that will do the following: 1. Ask the

More information

1. Create your First VB.Net Program Hello World

1. Create your First VB.Net Program Hello World 1. Create your First VB.Net Program Hello World 1. Open Microsoft Visual Studio and start a new project by select File New Project. 2. Select Windows Forms Application and name it as HelloWorld. Copyright

More information

Write the code for the click event for the Move>> button that emulates the behavior described above. Assume you already have the following code:

Write the code for the click event for the Move>> button that emulates the behavior described above. Assume you already have the following code: IS 320 Spring 2000 page 1 1. (13) The figures below show two list boxes before and after the user has clicked on the Move>> button. Notice that the selected items have been moved to the new list in the

More information

NEA sample solution Task 2 Cows and bulls (solution 2) GCSE Computer Science 8520 NEA (8520/CA/CB/CC/CD/CE)

NEA sample solution Task 2 Cows and bulls (solution 2) GCSE Computer Science 8520 NEA (8520/CA/CB/CC/CD/CE) NEA sample solution Task 2 Cows and bulls (solution 2) GCSE Computer Science 8520 NEA (8520/CA/CB/CC/CD/CE) 2 Introduction The attached NEA sample scenario solution is provided to give teachers an indication

More information

(conditional test) (action if true) It is common to place the above selection statement in an If block, as follows:

(conditional test) (action if true) It is common to place the above selection statement in an If block, as follows: Making Decisions O NE OF THE MOST IMPORTANT THINGS that computers can do is to make decisions based on a condition, and then take an action based on that decision. In this respect, computers react almost

More information

Learning the Language - V

Learning the Language - V Learning the Language - V Fundamentals We now have locations to store things so we need a way to get things into those storage locations To do that, we use assignment statements Deja Moo: The feeling that

More information

CSE 1530: Introduction to Computer Use II - Programming. 1a. [4 points, one point each] Define/explain any four of the following terms.

CSE 1530: Introduction to Computer Use II - Programming. 1a. [4 points, one point each] Define/explain any four of the following terms. 1. Basic Knowledge 1a. [4 points, one point each] Define/explain any four of the following terms. Algorithm: A set of step-by-step instructions that when completed, solve a problem. Procedural programming:

More information

Flow of Control. bool Data Type. Flow Of Control. Expressions. C++ Control Structures < <= > >= ==!= ! &&

Flow of Control. bool Data Type. Flow Of Control. Expressions. C++ Control Structures < <= > >= ==!= ! && Flow of Control Sequential unless a control structure is used to change the order Conditions, Logical s, And Selection Control Structures Two general types of control structures Selection (also called

More information

Chapter 12: Using Controls

Chapter 12: Using Controls Chapter 12: Using Controls Examining the IDE s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton A Label has been dragged onto Form1

More information

Mr.Khaled Anwar ( )

Mr.Khaled Anwar ( ) The Rnd() function generates random numbers. Every time Rnd() is executed, it returns a different random fraction (greater than or equal to 0 and less than 1). If you end execution and run the program

More information

On-Line Registration Preliminary Steps: BannerWeb /Mail Logins BannerWeb

On-Line Registration Preliminary Steps: BannerWeb /Mail Logins BannerWeb On-Line Registration Preliminary Steps: 1) Meet with your advisor to discuss your Academic Goals and to obtain your Alternate Personal Identification Number (PIN). 2) Review your Registration Status. This

More information

Chapter 5. Conditions, Logical Expressions, and Selection Control Structures

Chapter 5. Conditions, Logical Expressions, and Selection Control Structures Chapter 5 Conditions, Logical Expressions, and Selection Control Structures Data Type bool Chapter 5 Topics Using Relational and Logical Operators to Construct and Evaluate Logical Expressions If-Then-Else

More information

Chapter 5 Topics. Chapter 5 Topics. Flow of Control. bool Data Type. Flow of Control. Chapter 5

Chapter 5 Topics. Chapter 5 Topics. Flow of Control. bool Data Type. Flow of Control. Chapter 5 1 Chapter 5 Topics Data Type bool Chapter 5 Conditions, Logical Expressions, and Selection Control Structures Using Relational and Logical Operators to Construct and Evaluate Logical Expressions If-Then-Else

More information

Function Exit Function End Function bold End Function Exit Function

Function Exit Function End Function bold End Function Exit Function The UDF syntax: Function name [(arguments) [As type] ] [As type] [statements] [name = expression] [Exit Function] [statements] [name = expression] - name the name of the function - arguments a list of

More information

I101/B100 Problem Solving with Computers

I101/B100 Problem Solving with Computers I101/B100 Problem Solving with Computers By: Dr. Hossein Hakimzadeh Computer Science and Informatics IU South Bend 1 What is Visual Basic.Net Visual Basic.Net is the latest reincarnation of Basic language.

More information

PROGRAMMING LANGUAGE 2 (SPM3112) NOOR AZEAN ATAN MULTIMEDIA EDUCATIONAL DEPARTMENT UNIVERSITI TEKNOLOGI MALAYSIA

PROGRAMMING LANGUAGE 2 (SPM3112) NOOR AZEAN ATAN MULTIMEDIA EDUCATIONAL DEPARTMENT UNIVERSITI TEKNOLOGI MALAYSIA PROGRAMMING LANGUAGE 2 (SPM3112) INTRODUCTION TO VISUAL BASIC NOOR AZEAN ATAN MULTIMEDIA EDUCATIONAL DEPARTMENT UNIVERSITI TEKNOLOGI MALAYSIA Topics Visual Basic Components Basic Operation Screen Size

More information

Interface Design in C#

Interface Design in C# Interface Design in C# Project 1: Copy text from TextBox to Label as shown in the figure. TextBox and Label have the same property: display.text = nameentry.text; private void nameentry_textchanged display.text

More information

CS1046 Lab 4. Timing: This lab should take you 85 to 130 minutes. Objectives: By the end of this lab you should be able to:

CS1046 Lab 4. Timing: This lab should take you 85 to 130 minutes. Objectives: By the end of this lab you should be able to: CS1046 Lab 4 Timing: This lab should take you 85 to 130 minutes. Objectives: By the end of this lab you should be able to: Define the terms: function, calling and user-defined function and predefined function

More information

Chapter 1: Representing Data

Chapter 1: Representing Data - ١ - Chapter 1: Representing Data Data Variables and Constants When you input data into a computer, the computer stores it in its memory 1- Computer's memory consider as millions of little boxes. 2- Each

More information

Part 4 - Procedures and Functions

Part 4 - Procedures and Functions Part 4 - Procedures and Functions Problem Solving Methodology... 2 Top Down Design... 2 Procedures and Functions... 5 Sub Procedures... 6 Sending Parameters to a Sub Procedure... 7 Pass by Value... 8 Pass

More information

History. used in early Mac development notable systems in Pascal Skype TeX embedded systems

History. used in early Mac development notable systems in Pascal Skype TeX embedded systems Overview The Pascal Programming Language (with material from tutorialspoint.com) Background & History Features Hello, world! General Syntax Variables/Data Types Operators Conditional Statements Functions

More information

The High-Powered Database The Whole Team Can Use. USING LOTUSSCRIPT IN APPROACH

The High-Powered Database The Whole Team Can Use. USING LOTUSSCRIPT IN APPROACH E.D.I.T.I.O.N The High-Powered Database The Whole Team Can Use. USING LOTUSSCRIPT IN APPROACH Under the copyright laws, neither the documentation nor the software may be copied, photocopied, reproduced,

More information

2-18 Learn Visual Basic 6.0

2-18 Learn Visual Basic 6.0 2-18 Learn Visual Basic 6.0 Do Until/Loop Example: Counter = 1 Do Until Counter > 1000 Debug.Print Counter Counter = Counter + 1 Loop This loop repeats Until the Counter variable exceeds 1000. Note a Do

More information

Chapter 3 Selection Statements

Chapter 3 Selection Statements Chapter 3 Selection Statements 3.1 Introduction Java provides selection statements that let you choose actions with two or more alternative courses. Selection statements use conditions. Conditions are

More information

GUJARAT TECHNOLOGICAL UNIVERSITY DIPLOMA IN INFORMATION TECHNOLOGY Semester: 4

GUJARAT TECHNOLOGICAL UNIVERSITY DIPLOMA IN INFORMATION TECHNOLOGY Semester: 4 GUJARAT TECHNOLOGICAL UNIVERSITY DIPLOMA IN INFORMATION TECHNOLOGY Semester: 4 Subject Name VISUAL BASIC Sr.No Course content 1. 1. Introduction to Visual Basic 1.1. Programming Languages 1.1.1. Procedural,

More information

Fortran 90 Two Commonly Used Statements

Fortran 90 Two Commonly Used Statements Fortran 90 Two Commonly Used Statements 1. DO Loops (Compiled primarily from Hahn [1994]) Lab 6B BSYSE 512 Research and Teaching Methods The DO loop (or its equivalent) is one of the most powerful statements

More information

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 23 Introduction to Arduino- II Hi. Now, we will continue

More information

Visual C# Program: Resistor Sizing Calculator

Visual C# Program: Resistor Sizing Calculator C h a p t e r 4 Visual C# Program: Resistor Sizing Calculator In this chapter, you will learn how to use the following Visual C# Application functions to World Class standards: Opening Visual C# Editor

More information

Agenda. Strings 30/10/2009 INTRODUCTION TO VBA PROGRAMMING. Strings Iterative constructs

Agenda. Strings 30/10/2009 INTRODUCTION TO VBA PROGRAMMING. Strings Iterative constructs INTRODUCTION TO VBA PROGRAMMING LESSON5 dario.bonino@polito.it Agenda Strings Iterative constructs For Next Do Loop Do While Loop Do Loop While Do Until Loop Do Loop Until Strings 1 Strings Variables that

More information

3 Welcome Application 41 Introduction to Visual Programming

3 Welcome Application 41 Introduction to Visual Programming CO N T E N T S Preface xvii 1 Graphing Application 1 Introducing Computers, the Internet and Visual Basic.NET 1.1 What Is a Computer? 1 1.2 Computer Organization 2 1.3 Machine Languages, Assembly Languages

More information

DEMYSTIFYING PROGRAMMING: CHAPTER TEN REPETITION WITH WHILE-LOOP (TOC DETAILED)

DEMYSTIFYING PROGRAMMING: CHAPTER TEN REPETITION WITH WHILE-LOOP (TOC DETAILED) DEMYSTIFYING PROGRAMMING: CHAPTER TEN REPETITION WITH WHILE-LOOP (TOC DETAILED) Chapter Ten: Classes Revisited, Repetition with while... 1 Objectives... 1 10.1 Design... 1 Repetition process pseudocode...

More information

Visual C# Program: Temperature Conversion Program

Visual C# Program: Temperature Conversion Program C h a p t e r 4B Addendum Visual C# Program: Temperature Conversion Program In this chapter, you will learn how to use the following Visual C# Application functions to World Class standards: Writing a

More information

Visual Basic 2008 The programming part

Visual Basic 2008 The programming part Visual Basic 2008 The programming part Code Computer applications are built by giving instructions to the computer. In programming, the instructions are called statements, and all of the statements that

More information

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials Fundamentals We build up instructions from three types of materials Constants Expressions Fundamentals Constants are just that, they are values that don t change as our macros are executing Fundamentals

More information

Programming with the Peltier Tech Utility

Programming with the Peltier Tech Utility Programming with the Peltier Tech Utility The Peltier Tech Utility was designed so that much of its functionality is available via VBA as well as through the Excel user interface. This document explains

More information

d2vbaref.doc Page 1 of 22 05/11/02 14:21

d2vbaref.doc Page 1 of 22 05/11/02 14:21 Database Design 2 1. VBA or Macros?... 2 1.1 Advantages of VBA:... 2 1.2 When to use macros... 3 1.3 From here...... 3 2. A simple event procedure... 4 2.1 The code explained... 4 2.2 How does the error

More information

Object Oriented Programming with Visual Basic.Net

Object Oriented Programming with Visual Basic.Net Object Oriented Programming with Visual Basic.Net By: Dr. Hossein Hakimzadeh Computer Science and Informatics IU South Bend (c) Copyright 2007 to 2015 H. Hakimzadeh 1 What do we need to learn in order

More information