Question
Visual Basic Applications (VBA) Help! Its a Friday night in College Station and you decide to throw a pizza party for all your ISEN 230
Visual Basic Applications (VBA) Help!
Its a Friday night in College Station and you decide to throw a pizza party for all your ISEN 230 friends. You need to figure out how many pizzas to order and decide to use your newfound VBA passion to do so.
Step 1: Gather Inputs and Validate Numbers
Write a macro that asks how many people are coming to your party and assign the input to a variable. Next, the macro will ask how many slices of pizza each person will eat and assign the input to a new variable. Finally, the macro will ask how many slices of pizza will be ordered and assign the input to a new variable. If any of the inputs is not a number (Hint: use IsNumeric() function to check) , have a message pop up with a critical sign indicating that the input was invalid.
Step 2: Calculation and Give Feedback
If all three inputs are valid, make calculation to decide if enough slices have been ordered. If yes, have a message box pop up which indicates the number of slices ordered, the amount each person can eat, and how many slices will be left over. If not, have a message box pop up indicating that ordered amount of slices wasnt enough and how many more slices you will need to order.
Outputs should look something like this:
Victor Mulanovich Invalid Input How many people are coming to your pizza party? OK (Ox.15) is not a number Please try again. OK Victor Mulanovich Invalid Input How many slices of pizza will each person eat? OK (Rambo) is not a number Please try again. Cancel OK Victor Mulanovich Invalid Input How many slices of pizza will you order? OK (3.3.CecH) is not a number Please try again. Cancel OK Victor Mulanovich Ordering 150 slices of pizza will guarantee atleast1 pizza(s) per person You will have 50 slices left over OK Victor Mulanovich Ordering 80 slices of pizza is not enough. You will need to order 120 more slices. OKStep 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