Question
Exercise: Pinata pricing You sell three different types of pinatas. Pandas cost $14 each, lambs cost $12 each, and bunnies cost $9 each. Write a
Exercise: Pinata pricing
You sell three different types of pinatas. Pandas cost $14 each, lambs cost $12 each, and bunnies cost $9 each. Write a program that computes the total price of an order.
Heres a sample:
The program validates the three input fields. They should all be numbers zero or more. If any of them is bad, show one error message, like this:
Dont create your own workbook. Download this one instead. It has some code already there:
Private Sub cmdRun_Click()
Dim pandas As Integer
Dim lambs As Integer
Dim bunnies As Integer
Dim inputOK As Boolean
Dim totalPrice As Integer
Input
getInputs pandas, lambs, bunnies, inputOK
If Not inputOK Then
There was a problem with the input.
End
End If
Compute the total price.
computePrice pandas, lambs, bunnies, totalPrice
Output the total prie.
outputPrice totalPrice
End Sub
Dont change this code! Dont add or remove anything. Your job is to write the Subs. All the usual coding standards apply.
4 5 4 3 2 1 How many pinatas of each type would you like? 3 Panda 4 Lamb 5 Bunny Run 9 Price 35Step 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