Question
vb.net windows app Composed of ONE project with ONE form. The form and all controls should be named using VB standards. Within the code, using
vb.net windows app
Composed of ONE project with ONE form.
The form and all controls should be named using VB standards.
Within the code, using meaningful variable names that meet the VB standards and appropriate data types.
Comments are encouraged.
Form 1: Festival Fund Raiser:
This project will be used to track the options and income generated at a schools festival.
The information about the options that will be offered are stored in a text file named, Festival.txt which consist of 4 fields:
Category (Activities, Edibles, Games, Rides)Booth (Name of the booth)Sponsoring Grade LevelIncome Generated from the Booth
Sample records could look like:
Edibles,Cake Walk,Second Grade,1225.00
Edibles,Snack Bar,First Grade,998.50
Games,Go Fishing,Kindergarten,420.00
Games,Wheel of Fortune,Fourth Grade,380.00
Rides,Fire Truck,Fifth Grade,324.00
Rides,Horses,Sixth Grade,525.00
Rides,Hay Ride,Eighth Grade,510.00
Activities,Corn Maze,Pre-K,475.00
Activities,Haunted House,Seventh Grade,650.00
This purpose of this is to work with StreamReader so you MUST USE the StreamReader commands/code.
You will need to create the text file and code 3 button click events:
Display RecordsSearch for BoothAdd Record
Display Records Button Click Event:
Before you display the records in the Festival.txt file, you need to create a FileOK function that will make use of the Exists function to insure that the file can be found before the event is executed.
Once you have verified that the file does exist, you need to use StreamReader to display the records in a well formatted fashion (See sample below). Be sure to use ToString when displaying the Income field.
Search for Booth Button Click Event:
Before you begin to search the file to see if the booth name that was entered is in the file, you need to perform 2 data validations:
Make sure that the file does exists (Call the FileOK function again. DONT write a new function Reusable Code)Make sure the user did type something into the booth textbox (BoothOk function)
Once you have made sure that the file does exist and the a booth name has been entered in the textbox, search through the file using StreamReader to see if a record can be found with a booth name that matches the one entered by the user.
If a matching record is found, select the appropriate line in the Categories listbox and display the sponsoring grade level and income generated fields in the appropriate textboxes.
Add Record Button Click Event:
Before you add a record to the Festival.txt file, you need to create the following functions and sub:
InputOK is a data validation function that will make sure a category was selected from the category listbox, that information was entered into Booth and Sponsor textbox, and that a numeric value was entered into the Amount textbox.GetInput sub This sub should read values in and assign them to variables for category, booth, sponsor, and amount.NewCSV function Using the values obtained for category, booth, sponsor, and amount, the new record that will be added to the file should be created (remember it needs to be one string in csv format).
Once you have verified that the input needed to create the new record is valid, read the input values in and assignment them to appropriate variables. Using these variables values, create a new record.
Once the new record has been created, write it to the Festival.txt file.
CLEAN UP: Before ending the event, clear the contents of the input textboxes and deselect the line from the category listbox.
Hint: To make sure this worked correctly, so back and Display Records again Is the new record in the list? (If not, make sure you remembered to Close the file after the Add).
School Festival Booth: Categories Activities Edibles Games Rides Class: Amount Raised: Display Records Search for Booth Add Record School Festival Booth: Categories Activities Edibles Games Rides Class: Amount Raised: Display Records Search for Booth Add Record
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started