Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using visual basic Form 1: Spring Festival Snackbar Calculator Project: The purpose of this project is to calculate the total price that a customer needs

using visual basic
image text in transcribed
image text in transcribed
Form 1: Spring Festival Snackbar Calculator Project: The purpose of this project is to calculate the total price that a customer needs to pay for the snacks that they want to purchase at this year's Spring Festival. Four items are offered for sale at this snack bar: - Hamburgers - \$3.00 each - Fries - $1.00 each - Candy - $1.00 each - Drinks - $.50 each For each customer order, a unique order Id will be generated. This Id will be comprised of the first initial of the first name followed by the first initial of the last name and then a sequential number starting at 1000 and increasing by 1 for each order placed; for example - if the first customer is Daniel Young, his order ld will be DY 1000. FYI: We won't store the order number in a file at this time, so each time you run the program, the order Id will start over at 1000 . For this week's lab you need to write and test the following two functions: - Data Validation - The following checks should be made as part of your data validation: Make sure that text has been entered into the name textbox and that this name contains a space. - Make sure that a value has been entered into at least ONE of the food item textboxes. (To place an order, the user enters the number of each item that they wish to buy.) - Make sure that any values entered into a food item textbox is a numeric value. Once the Data Validation function has been written, test your code. Check each situation that you test for to make sure the appropriate message is displayed. FYI: I used 7 conditions to check all requirements in my code. Don't forget to Return True if all of the input is found to be valid. To test to see if the program would continue to execute when my input data was valid (the DataOk function retumed a True), I displayed a message box that simply let me know that the data was ok (see code sample below): Private Sub btnorderTotal_Click(...) Handles btnorderTotal.Click If Dataok ()= False Then Return End If MessageBox. Show("Data Ok") End Sub Order ID - This function should generate and return the Order Id which will be created using the classlevel order number variable (doesn't have to be passed) along with the event procedure's local name variable (does have to be passed). This variable will be comprised of the first initial of the first name followed by the first initial of the last name and then a sequential number starting at 1000 and increasing by 1 for each order placed; for example If the first customer is Daniel Young, his order Id will be DY 1000 . FYI: We won't store the order number in a file at this time, so each time you run the program, the order Id will start over at 1000 . To see if this function executes correctly, I once again used a message box. I also need to give a test value to the name variable within the code since the "Getlnput sub" has not yet been written. Below is the code that I added after my data validation to test this function. - Create a test value for the name variable Dim name, order As String name = "Daniel Thompson" order = OrderId(name) MessageBox. Show(order) Be sure to run this event more than one time to make sure that the order number portion of the order Id does indeed increase with each execution. While this is an incomplete program, once you have these 2 functions coded and tested that is what you need to turn in for the Week 6Lab Assignment. You will add the subprocedures that will finish the program off for next week's lab

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Discuss the six most common reasons firms pursue growth.

Answered: 1 week ago

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago

Question

What is meant by planning or define planning?

Answered: 1 week ago

Question

Define span of management or define span of control ?

Answered: 1 week ago