Calculator Working But Its Not Showing Numbers Seperated
Jul 11, 2011
All i made was a program to launch diffrent programs ^^. This is what I am currencly workin on: A calculator to calculate waves for example Wintermaul. I have writen this code:
[Code]...
View 1 Replies
ADVERTISEMENT
Jan 29, 2009
I've made a simple calculator, everything works except for the adding (+) function. Such as 3 + 4 = 34 (which it doesn't). It takes it as a string, rather than a number.
Here's what I have so far:
CODE:
Again, the problem is the adding is not functioning.
View 1 Replies
Jul 25, 2009
I've been browsing these forums the past couple days, and I've got most of my program figured out now, but I'm seeking advice as to where I should do a few calculations, and how I should pass my data between my input and my output forms. my basic program consists of a user entering 4 positive values on my main form - and then I calculate various constant percentages based upon these numbers. I then need to output these values into various labels on my output form. I have successfully implemented doing all of this on a single form, but I have over 30 outputs to display so it was a bit cluttered on a single form.
1) is it better to do all my calculations within the code of my input form and output the calculation results to the output form, or is it better to take my inputs, send those 4 values to the output form and do my calculations and output there? (i'm thinking it's the latter and is how i'm currently coding this)
2) in my second form, I cannot remember how to pass values between forms and I have not been able to find any examples that have jump started my brain into remembering. Currently I'm planning on sending my 4 inputs to the output form, doing the calculations, and outputting everything there.
for my input page:
Public Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
'each textbox is programmed to only allow numerals
'Get input from user
[code]....
and i think this will have the form calculate everything when it loads up. I'll later add code so that after I close it - I'll have my input form reset so i can immediately run another set of calculations. (currently not programed, i need to get the basics up first)
View 4 Replies
Aug 12, 2011
I have made my calculator and it has 2 textboxes where the 2 numbers (or values go for addition and subtraction) are input and a label where the answer appears. There is other things on the page such as quit, clear etc thats all done but i have one query. I noticed while testing a problem occurs when only one number or value is put into a textbox and a command is hit. For example. one textbox (txtnumber1) has one number in it then i hit multiply and it says the error of course because its not programmed to deal with this (or divide by 0 of course) so i was wondering how i could make so when this happens a MsgBox appears saying a value must be in both boxes or when divded by zero is says something similar.
The line of code:
Private Sub blah blah blah...
If txtnumber1.Text = False Then MsgBox("Please Input Valid Value")
End Sub
I however have not been able to make it work.
View 3 Replies
Nov 4, 2011
I can't get the loop to work.
View 1 Replies
May 11, 2010
I am having trouble getting the numeric keypad on my keyboard to work with my calculator. btn0 - btn9 are working, but the numeric keys +,_,*,/ are not working. They input the sign into the text box instead of clicking the button associated with the function on the calculator. I would like to be able to use the calculator as a 10 key adding machine of sorts. [Code]
View 5 Replies
Sep 14, 2011
I am slowly learning to program in visual basic and just spent the past 5 hours trying to fix this but just cant.
View 8 Replies
Feb 19, 2011
Im working on writing a program for doing standard deviation and as of right now im running into one slight issue with subtracting my mean from the original numbers. I will post most of my code so you can get an over view but i mostly just want help on this one little part for now. Im going to be making a website for school and put some programming stuff on it so i wanted to make just some random programs for it so this is school related but not really homework. It's line 26 and 27 that this is relating to. When i put a stop in my code and look at the result of arrayDifferences it gives me 0.0 when it should be -1. I know i can go this route and say arrayDifferences(1) = arrayDifferences(1) - arrayAvg but seeing as how i want this to be a random number of numbers input by the user i cant do that.
CODE:
View 4 Replies
Sep 13, 2009
This application seems to work. Basically I run a CustomerID and the dataview shows the customer incidents from the database file that are tied to that CustomerID It works, however when I start the program up the digits 27 through 43 are listed in the dataview, I have no idea where there coming from. When I run the CustomerID the numbers remain and the customer incidents that I want to appear in the dataview in fact do show up but I have to scroll down through those digits first.ere is the code behind the ASP file that is creating this.
Imports System.Data
Partial Class CustomerSurvey
Inherits System.Web.UI.Page
[code]....
View 5 Replies
Oct 21, 2009
I've got an app that sometimes stores some decently small numbers, such as 0.000023425. These numbers get loaded up in TextBox controls for users to edit.
Dim number As Double = 0.000023425
someTextBox.Text = number.ToString() ' Shows "2.3425E-05"
As mentioned, the text that shows is 2.3425E-05, which isn't exactly intuitive for the user to see, plus I have numbers even more precise (out to 19 decimal places). I would like the output to be fixed point. Of course I could easily and cleanly do:
number.ToString("F20") ' Shows "0.00002342500000000000"
But then there's an annoying number of zeros left over. So, to fix that, I could do:
number.ToString("#,##0.####################") ' Shows "0.000023425"
Which is what I want, but is there any better way to do it than to have that giant ugly format string there? So, ok, it's not that ugly, but surely there's a different way, right? My goal is to show the raw value being stored in the DB in a friendly way, and I would rather not have to force a format on the number at all.I found that changing the underlying datatype to Decimal solves the issue.
Dim number As Decimal = 0.000023425
someTextBox.Text = number.ToString() ' Shows "0.000023425" instead of "2.3425E-05"
So it sounds like Doubles aren't precise enough to be displayed normally?
View 3 Replies
Dec 29, 2009
[Code]...
i am not getting any errors either i am using Imports System.Net
View 2 Replies
Sep 30, 2011
Hi I've run into a really annoying problem, I'm trying to set the value of a hidden input to a comma seperated list taken from a database but in pure CSV format it won't set the value.The input tag and ul tag looks like this (I am aware of asp:hiddenfield and it's value property but I'm not using it as I still have this issue):
[code]...
This will populate the li tags but will not populate the value for the input, I've tried using the replace function on the list for the value but it only works if I remove the commas or put other characters infront of them. I've also tried replacing it with the HTML code for a comma but just prints the HTML code out.
View 1 Replies
Nov 13, 2009
i have a dropdownlist which has a linq datasource ...and i have inserted 2 items "All Batch" and "Choose" from the codebehind manully...in case of mozilla firefox "Choose" is automatically selected as default in the dropdownlist but in case of IE6 the default selection in dropdownlist is blank but the items are there if we scroll the list.
View 2 Replies
Jul 30, 2009
this is the code
Dim con As New OleDb.OleDbConnection
Dim com2 As New OleDbCommand
Dim constring As String = ConfigurationManager.ConnectionStrings("esourcecon").ConnectionString
con = New OleDbConnection(constring)
com2 = New OleDbCommand("UPDATE Customer SET CName = @CName, CAdd= @CAdd, CTel= @CTel, Cmob= @CMob WHERE CName='" & C1.Text & "' ", con)
[Code]...
id is an autonumber field and if i change the where string to another column then also i dont get any error and the values are still not entered
View 9 Replies
Feb 18, 2012
[Code]...
The loop will run about 3 times then overflow. I guess no matter what u do xor will result in Byte,Integer or Long. CDec(Key) will not work I need a way to bypass this so i can Xor large numbers.
View 1 Replies
Oct 25, 2010
How can I calculate 2^ 3333 in vb.net it calculates up to 2^ 60 it says infinite for this calculation. Is tehre any way to work with really large numbers?
View 1 Replies
Sep 22, 2009
I've been messing around with prime numbers for a while now, but I now want to use massive numbers, say a few million digits in length. Is there a way of storing and performing mathematical functions with such large numbers? Is it even possible on my home computer? I read on another old thread, something about a big number library, but the links he gave are now dead.
View 1 Replies
Apr 28, 2011
For example, to calculate this:(22 ^ 29) Mod 57Supposedly there is a way to get around overflows and do these calculations, but I can't find much online. Now, the person who said this was doing VBA in Excel and said that there was about 4 lines of code which could handle the overflow so it wouldn't happen.
View 4 Replies
Feb 22, 2010
I am a newbie programmer and I need a way to generate random numbers for a program I am working on. It just needs to be something simple that generates a number and allows me to assign it to a variable. I would like it to be something small say 1-10 would be good and an explanation of the syntax would be helpful
View 9 Replies
Jun 13, 2011
I'm working on a Windows forms app that will average a set of numbers, the only catch is that there are 10 textboxes(4 in the example for times sake), and not all of the textboxes could be filled with a number...I know that if i had a given set of numbers:
Dim a, b, c, d As Integer
a = t1.Text
b = t2.Text
c = t3.Text
[code].....
View 2 Replies
Apr 1, 2009
intLoginTime = txtLoginTime.Text
intLogoutTime = txtLogoutTime.Text
[CODE]..........
The problem is that the numbers seem to round after the decimal point, so if I entered a login-time of 8.15 and log-out 9.30, instead of showing 1.15 as the difference, it shows '1'. is there a way around this?
View 13 Replies
Nov 18, 2010
I have a sql query something like below,
create procedure test
(
@param1 nvarchar(max)
)
[code]....
Now I need to pass the value of @param1 from my .net application in such a way that the above query works.how from my vb.net code i can pass a value which is similiar to below
'1','2','3'
how do I structure value of parameter like above example from my .net application.
View 3 Replies
Feb 23, 2010
I'm having a little trouble with this... I have a Session variable which contains a string of comma separated ID's which needs to be passed to a stored procedure but if it is more than 8000 characters, it needs to be split into more comma separated strings. For example;
[Code]...
View 4 Replies
Mar 31, 2011
I have a problem with the combox its only displaying the first item in the list its being populated by a webserice call the drop down in question is comboboxmodel now the manufacture one is fine and sets as it should any reason as to why the comboboxmodel would not. [code]
View 1 Replies
Jun 21, 2010
I have six textboxes, and upon button press it randomly generates six numbers, one in eact text box e.g. [43] [85] [93] [1] [0] [17]..i create another six textboxes and at the same time allocate these numbers in ascending/descending numbers.I am not looking for any codes whatsoever, as i love the challenge of VB.Net.
View 2 Replies
Apr 7, 2009
Im trying to write a program that will do:
1.The average of the four numbers. This answer will be placed into a text box reserved for that value. This text box cannot be changed by the user.
2.The maximum and minimum values. These will be denoted by changing the color of the largest number green and the smallest number red.
3.The range of the numbers. The range is defined as the difference between the largest and smallest numbers. The range will be placed into its own text box, labeled as such. This text box cannot be changed by the user."
Im using visual studio 2008 and it has to be written in VB
View 35 Replies
Aug 16, 2009
So how would I use .next (random numbers) to randomly select something from a list of numbers but it can't repeat the number?I could do:
dim num as integer
dim r as new random
num = r.next(1,5)
if num = 1 then
elseif num = 2 then
etc.
That wouldn't work because it would repeat.If I donwload someone's game can I disect it in VS? :0 I tried going to open project, then I went to the folder and clicked open. It brought me inside of the folder so I tried to open the game but there is no form1 there. It says the games name then .exe in the explorer-like thing in the top right?Also, how would I have a value or something in a label and access it from a button.
Example:This is in a label.
Dim number as Integer
number = 0
Then in the button do
Label.number = 0
How would I do something like that? I want to use that a lot as I did in a different language.
View 6 Replies
Mar 18, 2011
I have a program that allows a user to input numbers from an inputbox and it displays the Total numbers entered, the sum of the numbers entered, and the average of the numbers entered. What I can not seem to find it how to have it display the largest number entered. The code I have so far is,
[Code]...
View 11 Replies
Mar 28, 2010
how can i add two excel sheets with numbers and the equal (similar)numbers to save once
View 1 Replies
Oct 4, 2011
I am making a program, where the user enters 6 numbers in 6 different text boxes, and it displays the larger of those 6 numbers. But I also want to make it where if the user enters a string value (like S for instance) in the text boxes, it gives an message and says "please enter the numbers again" and the user gets to enter the 6 numbers again. But when I do try to do that, it gives an error message saying conversion from "w/e the user entered" to Double is not valid. If the user just enters the numbers, it works fine. However, I am trying to make it if the user does enter non numeric value, it gives a message window and the user can reenter the numbers again.
Here is my code Example
CODE:
This is where I am trying to use IsNumeric to show a message if a user does not enter a string so the user can renter the numbers again, but when the user does enter a string value (say in textbox 1) it gives me an error message saying conversion from "S" to 'double' is not valid.
CODE:
Then right here this is where I have my series of ifs statements, this part works fine, it displays the largest numbers of the 6 textboxes every time. Error free.
CODE:
And do this with variable number 2, 3, 4, 5.
I know there are easier ways to do these with arrays and stuff. But I am not there yet. I am still learning about ifs and stuff.
View 8 Replies