Computer Learning Zone CLZ Access Excel Word Windows

All things good to know are difficult to learn.

-Greek Proverb
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 

Introduction

Welcome! Hot Dog Stand App: Sales & Logs


 S  M  L  XL  FS | Slo Reg Fast 2x 

In this lesson, we begin our introduction to Visual Basic by outlining how to create a hot dog stand application that tracks sales of hot dogs, French fries, and soft drinks, calculates extended prices, sales tax, and order totals, and appends sales information to a text file for analysis in Excel or Access. We will discuss how to print and format receipts, and introduce concepts like variables, user-defined types, arrays, modules, Sub Main, public subroutines, and constants. Prerequisites and class resources are also explained, along with recommendations for how to follow along with the material.

Navigation

Keywords

, hot dog stand application, Visual Basic 6.0, hot dog sales tracking, append to text files, sales log, calculate order total, sales tax, receipt printing, variables, arrays, Sub Main, public subroutines, constants, Visual Basic project

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Introduction
Get notifications when this page is updated
 
More Information
Transcript 
Welcome to Visual Basic 202, brought to you by VBLearningZone.com. I am your instructor, Richard Rost.

In today's class, we are going to make a hot dog stand application. We are running a hot dog stand, and I want to be able to track how many hot dogs I am selling, as well as French fries and soft drinks. I want to calculate the quantity of each sold, the price of each, and then figure out the extended price, the sales tax, and the order total.

Then I am going to show you how to append to text files, so you can create a history log of all your sales. At the end of the day, you can load that information into Excel or Access, and calculate your daily sales totals.

We are going to see how to print a receipt and how to format it using Notepad. We will learn a lot more about variables, user-defined types, arrays, modules, Sub Main, public subroutines, constants, and lots and lots of miscellaneous functions.

The prerequisite for this class is Visual Basic 201. Before taking this class, I recommend you take 101 through 107, and then 201.

There is, of course, a web page for this class located at vblearningzone.com?geovb202. On this page, you will find sample project files, the course outline, and the student discussion forum. If you have any questions about the material covered in today's class, post them here on the discussion forum.

If you are watching this class in the Annecrane Video Player or online theater, you will see this page load up to the right of the videos. Join the discussion by posting your thoughts here in the student discussion forum.

In today's class, I will be using Microsoft Visual Basic 6.0. If you are using a different version of VB, such as VB.NET or VB205, you will find that the interface is different; however, most of the Visual Basic programming code will work just fine.

I strongly recommend you sit back, relax, and watch each video through once without doing anything. Then, replay the video again, and follow along with the examples, building each project as I do.

Do not try to apply what you are learning immediately to other projects that you might be working on. Instead, build the sample project in class with me.
Intro 
In this lesson, we begin our introduction to Visual Basic by outlining how to create a hot dog stand application that tracks sales of hot dogs, French fries, and soft drinks, calculates extended prices, sales tax, and order totals, and appends sales information to a text file for analysis in Excel or Access. We will discuss how to print and format receipts, and introduce concepts like variables, user-defined types, arrays, modules, Sub Main, public subroutines, and constants. Prerequisites and class resources are also explained, along with recommendations for how to follow along with the material.
Quiz 
Q1. What is the main goal of the hot dog stand application being built in this class?
A. To track sales, calculate totals, and print receipts
B. To create a game for selling hot dogs
C. To display pictures of food items
D. To evaluate employee performance

Q2. Which items are being tracked in the hot dog stand application?
A. Hot dogs, hamburgers, and pizza
B. Hot dogs, soft drinks, and French fries
C. Sandwiches, chips, and sodas
D. Tacos, nachos, and ice cream

Q3. What will the application be able to calculate for each order?
A. Only the total profit
B. Extended price, sales tax, and order total
C. Employee bonuses
D. Inventory restock levels

Q4. What feature will be added to keep a history log of all sales?
A. Email notifications
B. Appending to text files
C. Printing to color printers
D. Sending data to a web server

Q5. What can you do with the text file created by the application at the end of the day?
A. Erase it each night
B. Load the information into Excel or Access
C. Encrypt it for security
D. Delete it automatically

Q6. What suggestion does the instructor give for learning from the video lessons?
A. Build your own different project while watching
B. Sit back, watch once, then replay and follow along with the examples
C. Skip ahead to the last video
D. Memorize the script before starting

Q7. What programming concepts will be covered in this class?
A. Web development and user interface design
B. Variables, user-defined types, arrays, modules, Sub Main, public subroutines, constants, and miscellaneous functions
C. Graphic design and animation
D. Mobile app development

Q8. Where can students find sample project files and participate in a discussion forum for this class?
A. On the instructor's social media page
B. vblearningzone.com?geovb202
C. At a local library
D. In the appendix of the textbook

Q9. What is strongly recommended when watching the class videos?
A. Take extensive notes without watching the screen
B. Watch the videos in reverse order
C. Watch each video through once without doing anything, then follow along on a replay
D. Only read the transcript and not watch the videos

Q10. What should you do if you have a question about the material covered in class?
A. Call the instructor directly
B. Post your question in the student discussion forum
C. Search online for unrelated tutorials
D. Wait until the next course

Answers: 1-A; 2-B; 3-B; 4-B; 5-B; 6-B; 7-B; 8-B; 9-C; 10-B

DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.
Summary 
Today's video from the Visual Basic Learning Zone focuses on creating a hot dog stand application using Visual Basic. I will guide you through the process of managing a simple sales tracking program for hot dogs, French fries, and soft drinks. The goal is to keep track of the quantities sold for each item and determine their individual prices. From there, I will show you how to calculate the extended price for each product, add up the sales tax, and come up with an accurate order total.

Another key topic in this lesson is working with text files. I will demonstrate how to append sales data to a file, enabling you to create a running log of all your transactions. At the end of each day, you will have a record that you can bring into Excel or Access, making it easy to review and total up your daily sales.

Printing receipts is also an important part of the class. We will cover how to send a receipt to the printer and make sure it comes out properly formatted, even if you are just using Notepad.

Throughout the lesson, we will dive further into concepts like variables, custom user-defined types, arrays, modules, and the Sub Main procedure. I will also spend some time on public subroutines, constants, and a wide range of useful functions that will help you develop stronger Visual Basic applications.

This course builds on concepts from Visual Basic 201, so you should complete not only 201 but also the earlier courses 101 through 107 if you have not already done so. All the supplemental materials and resources for this class can be found on my website in the section for this course. There, you will also find forums where you can ask questions and discuss the material with fellow students.

For this lesson, I am using Microsoft Visual Basic 6.0. If you are using a newer version like VB.NET or VB205, you will notice some differences in the user interface, but most of the core Visual Basic code we cover here will still be applicable.

My recommendation for getting the most out of this course is to watch each video all the way through the first time to get an overview of the material. Then, go back and replay the lesson, building each example project along with me. This approach will help you fully understand the concepts before you try to apply them to your own projects. Stick to the course examples first to get comfortable with the tools before moving on to independent work.

You can find a complete video tutorial with step-by-step instructions on everything discussed here on my website at the link below. Live long and prosper, my friends.
Topic List 
Creating a hot dog stand application
Tracking sales of hot dogs, fries, and soft drinks
Calculating quantity, price, and extended price
Calculating sales tax and order total
Appending sales data to text files
Creating a sales history log
Exporting sales data to Excel or Access
Printing receipts and formatting in Notepad
Using variables and user-defined types
Working with arrays and modules
Using Sub Main and public subroutines
Defining and using constants
Common Visual Basic functions for applications
Article 
Welcome to this Visual Basic tutorial where we will build a simple but effective hot dog stand application. The goal is to create a small program to track how many hot dogs, French fries, and soft drinks are sold at your stand, calculate the total price for each, add sales tax, and determine the entire order total. Along the way, you will learn several key Visual Basic programming concepts, including working with variables, arrays, constants, user-defined types, modules, public subroutines, and some useful functions.

To begin, imagine you are running a hot dog stand. You want to enter the number of hot dogs, fries, and soft drinks sold for each order, and have the program automatically calculate the subtotal, sales tax, and total, as well as keep a running history of all your sales for later review.

First, we will set up the variables we need in our program. For each menu item, you need to store the quantity sold and the price per item. For example, you can use variables like HotDogQty, FryQty, DrinkQty, as well as constants for the prices such as HOT_DOG_PRICE, FRY_PRICE, DRINK_PRICE. Using constants for prices lets you easily change them in one place if you need to.

Here is a simple example of how to declare your constants and variables at the top of your form or module:

Const HOT_DOG_PRICE As Currency = 2
Const FRY_PRICE As Currency = 1.5
Const DRINK_PRICE As Currency = 1
Const SALES_TAX_RATE As Double = 0.08

Dim HotDogQty As Integer
Dim FryQty As Integer
Dim DrinkQty As Integer

You can set up your form with three TextBox controls where the user will enter the quantities for each item, and Labels to show the subtotal, tax, and total.

When the user clicks a button to calculate the total, your program should read in the quantities, multiply each by its price, and sum them up to get the subtotal. Here is how you might write the calculation logic in a subroutine:

Private Sub btnCalculate_Click()
HotDogQty = Val(txtHotDogQty.Text)
FryQty = Val(txtFryQty.Text)
DrinkQty = Val(txtDrinkQty.Text)

Dim subTotal As Currency
subTotal = HotDogQty * HOT_DOG_PRICE + FryQty * FRY_PRICE + DrinkQty * DRINK_PRICE

Dim tax As Currency
tax = subTotal * SALES_TAX_RATE

Dim orderTotal As Currency
orderTotal = subTotal + tax

lblSubtotal.Caption = FormatCurrency(subTotal)
lblTax.Caption = FormatCurrency(tax)
lblTotal.Caption = FormatCurrency(orderTotal)
End Sub

This subroutine reads in the quantities from the text boxes, performs the calculations, adds the sales tax, and displays the results in label controls.

To keep track of each sale, you can append the sales data to a text file as a simple log. Each time an order is processed, open the file in append mode, write the details, and close the file. Here is an example subroutine to save the sale:

Private Sub SaveSaleToFile()
Dim fileNum As Integer
fileNum = FreeFile

Open "C:\HotDogSales.txt" For Append As #fileNum
Print #fileNum, Now & "," & HotDogQty & "," & FryQty & "," & DrinkQty & "," & lblSubtotal.Caption & "," & lblTax.Caption & "," & lblTotal.Caption
Close #fileNum
End Sub

Call this subroutine from your calculate button after showing the total. This keeps a simple log with each sale date and all the order details, which you can later import and analyze in Excel or Access.

If you would like to print a simple receipt for the customer, you can create a text file formatted as a receipt and open it in Notepad. Here is how you can achieve that:

Private Sub PrintReceipt()
Dim fileNum As Integer
fileNum = FreeFile

Open "C:\HotDogReceipt.txt" For Output As #fileNum
Print #fileNum, "Thank you for your order!"
Print #fileNum, "Hot Dogs: " & HotDogQty & " x $" & HOT_DOG_PRICE
Print #fileNum, "Fries: " & FryQty & " x $" & FRY_PRICE
Print #fileNum, "Drinks: " & DrinkQty & " x $" & DRINK_PRICE
Print #fileNum, "------------------------------"
Print #fileNum, "Subtotal: " & lblSubtotal.Caption
Print #fileNum, "Sales Tax: " & lblTax.Caption
Print #fileNum, "Total: " & lblTotal.Caption
Print #fileNum, "Date: " & Now
Close #fileNum

Shell "notepad.exe C:\HotDogReceipt.txt", vbNormalFocus
End Sub

This will write out a formatted receipt, then open it in Notepad ready to print or save.

Throughout this project, you can further organize your code by creating separate modules for repeated routines, use arrays if you have more menu items, and learn how to define your own data types for more complex data storage.

By building this project, you will gain practical experience in critical Visual Basic concepts like working with variables, constants, arrays, TextBox and Label controls, writing to files, and modular code design. At the end of a sales day, you can use the saved text file to analyze your total sales and import the data into software like Excel or Access for more detailed reporting.

Take your time to build this application step by step, testing each piece as you go. Focus first on calculating totals, then add the file logging, and finally try creating and printing receipts. If you want to go further, you can add error checking, a user-friendly interface, or even reporting tools as your skills improve. This project is an excellent way to practice hands-on Visual Basic programming and will provide a solid foundation to build more complex business applications in the future.
Primary Topics 
application development, sales tracking, variables, user-defined types, arrays, modules, public subroutines, constants, file I/O, receipt formatting
Secondary Topics 
data export, discussion forums, interface differences
 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 10/5/2026 12:06:24 PM. PLT: 1s
Keywords: , hot dog stand application, Visual Basic 6.0, hot dog sales tracking, append to text files, sales log, calculate order total, sales tax, receipt printing, variables, arrays, Sub Main, public subroutines, constants, Visual Basic project  PermaLink  How To Build a Hot Dog Stand App With Sales Tracking and Text File Logging in Visual Basic