This simple little program will calculate the area, circumference and the diameter of a circle. If the user has entered a non numeric character it will inform them. Please leave your comments and votes, thanks :)
Terms of Agreement:
By using this code, you agree to the following terms...
You may use
this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
You may link to this code from another website, but ONLY if it is not wrapped in a frame.
You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
' Name: [ A program to calculate the area, circumference and diameter of a circle. ] UPDATED!!!
' Description:This simple little program will calculate the area, circumference and the diameter of a circle. If the user has entered a non numeric character it will inform them. Please leave your comments and votes, thanks :)
' By: JamesJD
' Inputs:One TextBox, one CommandButton, and three Labels. (You just need to keep their default names).
' Returns:The values of a circles area, circumference and diameter.
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=47415&lngWId=1'for details.'**************************************
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox ("Please enter a number in the text box!")
If IsNumeric(Text1.Text) = False Then
MsgBox ("Please enter a numeric value!")
Text1.Text = ""
Radius = Text1.Text
Diameter = Val(Radius) + Val(Radius)
Area = 3.14159 * (Radius * Radius)
Circumference = 3.14159 * (Val(Radius) + Val(Radius))
Label1.Caption = "Diameter: " & Diameter
Label2.Caption = "Area: " & Area
Label3.Caption = "Circumference: " & Circumference
Text1.Text = ""
you are required to design a program that calculates the volume/ surface area of 3-D shapes as well as area/perimeter of 2-D shapes of some selected objects based on user’s choice. The program should allow the user to pick the shape from a list. Available 2-D shapes are (square, rectangle, triangle, circle, rhombus, parallelogram) while available 3-D shapes are (cube, rectangular 3-D box, cone, sphere, cylinder). Upon shape selection, the user has to be asked to enter the appropriate data to calculate either the area/perimeter or the volume/surface area. The program has to be as robust as possible for different errors in data entered by the user like letters instead of numbers, negative numbers…etc (If this comment was disrespectful, please report it.)
and The project should have a welcome screen that shows the team names as well as some introductory information about the program. It should also have login fields asking for a user name and a password. In addition to that, the ability to change the password to a new one should be available to those users entering correct user names and old passwords. The password has to be formed of 5 characters with at least one number. thnx (If this comment was disrespectful, please report it.)
So far so good (If this comment was disrespectful, please report it.)
Add Your Feedback
Your feedback will be posted below and an email sent to
the author. Please remember that the author was kind enough to
share this with you, so any criticisms must be stated politely, or they
will be deleted. (For feedback not related to this particular code, please
click here instead.)