Hi,
I need the code for following 3 VB programs.
I have limited experience in VB so Code has to be written very simply
so I can understand and modify it J
I f you do it quickly and explain what you do in each step then I give
you more project and rate it 5 star
Have fun
googooly
Project 1: Calculate area and perimeter
Operation
· · The user enters values for the length and width of a
rectangle and clicks on the Calculate button.
· · The application then displays the area and perimeter of
the rectangle in the third and fourth text boxes.
Specifications
· · The formula for calculating the area is width * length.
· · The formula for calculating the perimeter is 2 * width + 2
* length.
· · Assume that the user will enter valid numeric data for the
length and width so your code doesnt have to check these entries for
validity.
Enhancements
If you understand the coding in chapter 1, you can add these
enhancements right now. Otherwise, you can wait until after youve
read chapter 2 before you add these enhancements.
· · Add code that checks the validity of all entries.
· · Add code that checks for all other error conditions.
Note
· · Although you might think that you could calculate the
perimeter using the formula
2 * (width + length)
you cant. Thats because when you use the + operator with text
strings, it concatenates the strings rather than adding them. However,
you could use the Val function like this to convert the width and
length to numeric values first:
2 * (Val(width) + Val(length))
Project 2: Calculate sales tax and grand total
Operation
· · The user enters the sub total amount and clicks on the
Calculate button.
· · The application then calculates and displays the sales tax
amount and the grand total amount in label controls (not text boxes).
Specifications
· · The sales tax percentage is 0.0785 (7.85%).
· · The sales tax calculation is sub total * sales tax
percentage.
· · The grand total calculation is subtotal + sales tax.
· · Assume that the user will enter valid numeric data for the
sub total so your code doesnt have to check this entry for validity.
Enhancements
If you understand the coding in chapter 1, you can add these
enhancements right now. Otherwise, you can wait until after youve
read chapter 2 before you add these enhancements.
· · Add code that checks the validity of each entry.
· · Add code that checks for all other error conditions.
Project 3: Convert temperatures
Operation
· · When the user clicks on an option button to determine the
type of conversion to be done, the application clears both text boxes
and locks the one that the result will be displayed in.
· · When the user enters a valid numeric entry and clicks on
the Calculate button, the application displays the result in the
locked text box.
· · When the user enters an invalid entry, the application
displays an appropriate error message in a message box. When the user
responds to the message, the focus returns to the text box.
Specifications
· · The formula for converting the temperature from Fahrenheit
to Celsius is (F-32)*5/9.
· · The formula for converting the temperature from Celsius to
Fahrenheit is (C*9/5)+32.
· · Write the code so the application is as quick and easy to
use as possible. For example, the Calculate button should be activated
when the user presses the Enter key, and the focus should be moved to
the appropriate control when the user clicks on an option button or
presses the Tab key.
· · Write the code so it checks all entries for validity and
catches any other errors without blowing up. |