Question
This class is Visual Basics..... Follow the instructions below and implement them as listed. Name the variables and controls exactly as listed. We will create
This class is Visual Basics.....
Follow the instructions below and implement them as listed. Name the variables and controls exactly as listed.
We will create a Price calculator. The user will type a Price (a number more than 0) and enter number of units (a number more than or equal to 1) then click the total button. The Total "so far" is displayed to the screen. The user may repeat the process, to add more units and prices, repeatedly till they either Quit the application or hit the Reset button. Complete the following to accomplish this outcome:
Write code so when the user hits Total, the code:
gets the value from a Pricetxt textbox and assigns it to a variable named PriceSng using the Csng conversion. Ask questions in the Discussion if you do not know how to do this.
the code then checks that PriceSng is > 0, if not issue an error message "Enter positive numbers only". None of conditions or actions below should execute. Do not use Exit or Return statements. Use Elseif for code behavior to happen.
If the above check passes, then check that UnitsInt is more than or equal to 1, otherwise show an error message "Units must be more than 1". Again, None of conditions or actions below should execute. Do not use Exit or Return statements. Use Elseif for code behavior to happen.
The logic to calculate the accumulated Total is this: Create a global variable TotalSng in a Single type, and assign it to 0.0. Under the Total button, use this formula: x + (PriceSng*UnitsInt*(1+TaxRate) where x is the current Total, PriceSng is the current price and UnitsInt is the number of items of that price, and TaxRate is a constant assigned to the TaxRate in Los Angels represented as fraction, e.g. 0.09.
All messages shown must use messagebox.show, and nothing else.
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