SLIDE 13 The Visual Basic .NET Coach 13
Chapter 4 – Decision Making
Example: In Stock? Problem Description
The application will ask the user to enter the amount of a product a company has on hand. If the number is greater than 0, then the program outputs that the “Product is in Stock”. Otherwise, it outputs that the “Product is Sold Out”.
Problem Discussion
It will require creating a form with a txtStockAmount text box to store the amount of a product a company has in stock, a lblAmount label with the Text property set to “Amount in Stock”, another label, lblInStock, to hold a message, and a button with the Text property set to “Calculate”. The code of the program compares the number entered by the user to 0.