Google Answers Logo
View Question
 
Q: I need 3 VB programs ( No Answer,   3 Comments )
Question  
Subject: I need 3 VB programs
Category: Computers > Programming
Asked by: googooly-ga
List Price: $15.00
Posted: 11 Feb 2003 21:32 PST
Expires: 13 Mar 2003 21:32 PST
Question ID: 160314
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 doesn’t 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 you’ve
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 can’t. That’s 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 doesn’t 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 you’ve
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.

Request for Question Clarification by hammer-ga on 12 Feb 2003 07:44 PST
1. Do you need VB6 or VB.Net?

2. There are references to adding enhancements once you've read
Chapter 2. Do you want these enhancements included?

3. Be aware that we don't have the book these "chapters" are in and
may do things differently than the book.

- Hammer

Clarification of Question by googooly-ga on 17 Feb 2003 22:54 PST
Ok,
Sorry everyone I was in vacation in past few days and looks like there
is many 3 answers,all of them are grate however I have to take my
pick.

hammer you got it.

Thanks 
Googooly

1. Do you need VB6 or VB.Net? 
>>> VB6
 
2. There are references to adding enhancements once you've read
Chapter 2. Do you want these enhancements included?

>>>>Sorry if  I made you confuse just do the enhancement and I will
tip you for it :)
 
3. Be aware that we don't have the book these "chapters" are in and
may do things differently than the book.


>>>Don’t worry if is different I’m just tiring to understand the
concept. I will change your code to be like book.

Request for Question Clarification by hammer-ga on 18 Feb 2003 04:13 PST
Googooly,

I have not actually answered your question. If one of the code samples
below does it for you, then you've gotten your question answered for
free! :)

If not, please post that you still need an answer and one of the
Researchers (possibly me) will likely answer your question.

- Hammer

Clarification of Question by googooly-ga on 18 Feb 2003 20:08 PST
Oh sorry I missed stinger_60284-ga. I believe he/she has already
written the code for this question
Stinger please post your answer and I will pay you.

Thanks,
googooly

Request for Question Clarification by hammer-ga on 25 Feb 2003 12:40 PST
Stinger is not a Researcher and, therefore, cannot get paid for this
question. Basically, Stinger has done you a nice favor, and you have
gotten your question answered for free! I'd say it worked out quite
well for you. :)

- Hammer
Answer  
There is no answer at this time.

Comments  
Subject: Re: I need 3 VB programs
From: stinger_60284-ga on 12 Feb 2003 15:40 PST
 
I have made the program based on your criteria.
Download it here:
http://204.176.38.119/Q11022003.zip

If this meets yours then I'll post the code.

Cheers,

Stinger
Subject: Re: I need 3 VB programs
From: johnmir-ga on 14 Feb 2003 20:51 PST
 
'Program 1 for windows os . create a *.vbs file. open it with notepad.
paste code into file. double click on the *.vbs

'''''''''''''''''''''''''''''''''''''''''''''''
'calculate area & perimeter


'user enters input
length=inputbox("Input Rectangle Length: ","Rectangle Length")

width=inputbox("Input Rectangle Width: ","Rectangle Width")


'check if its not empty string
if width="" or length="" then

msgbox "Failed to provide corrrect input!",48,"Error"

else
  
   verify=msgbox("Rectangle" & vbNewline & "Width: " & width & 
vbNewLine_ & "Length: " & length & vbNewLine & vbNewLine & "Click on
OK button to_ calculate Area and Perimeter of rectangle, or otherwise
click on_ Cancel.",1,"Area & Perimeter")

    '1 = clicked on OK button, 2= cancel
    if verify=1 then

    perimeter=2*length+2*width
    area=length * width
    msgbox "Rectangle" & vbNewline & "Width: " & width &  vbNewLine_ &
"Length: " & length & vbNewLine & vbNewLine & "Area: " & area &
vbNewLine_ & "Perimeter: " & perimeter,48,"Area & Perimeter"

     end if

end if
Subject: Re: I need 3 VB programs
From: johnmir-ga on 14 Feb 2003 20:55 PST
 
make sure that the code for one function fits on 1 line. I tried to
put _ to separate the code but when it posted - it was a little off so
remove _ and make sure that every single function is on one line.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy