'if / Else Calculation Statements
Oct 6, 2010
I am using Microsoft Visual Studio 2008 with VB.NET, and in class we were assigned this project: A procedure should calculate a 2% price increase on all red shirts, but a 1% price increase on all other items. In addition to calculating the price increase, the procedure also should calculate the new price. You can use the variables strItemColr, strItem, decOrigPrice, decIncrease, and decNewPrice. Format the original price, price increase, and new price in the lblOriginal, lblIncrease, and lblNewPrice controls, respectively.
View 1 Replies
ADVERTISEMENT
Oct 11, 2009
Can someone give me a site to a tutorial that will help me write a program that will generate a pattern using do while, if else statements,and do until statements. I have been using google but I can't find anything. I need to generate patterns a certain size 6 by 6 or similar such as something like a checkerboard but where the ^ symbols is there a suppose to be a blank space..
View 3 Replies
Dec 19, 2009
I need to store a calculation to use later and obtain a new calculation
[Code]...
View 4 Replies
Mar 14, 2012
I am trying to figure out how to do this:
if (phrase = hello) then
"say hello"
if (phrase = how are you?) then
[CODE]...
So basically, I want it to work like a timeline. If I say hello, then it will respond and move onto the next if statement. Get it?
Here is the code I have now:
If phrase.Result.Text = "hello" Then
synth.Speak("Hello to you too")
If phrase.Result.Text.Contains("How are you") Then
[CODE]...
View 21 Replies
Mar 9, 2009
Heres my code in vb 2008[code]...
I need to add 15% vat to it and i have no clue how to add the 15% vat.
View 1 Replies
Aug 29, 2010
compute an exact age of a person using the format date of mm/dd/yy... in vb.net, i was trying to code it but the result was not the exact age of the person.lp me...
View 11 Replies
Oct 18, 2011
I have to Create a Bowling Scores application that allows the user to enter 5 scores and then displays the high score and the low score and then clicking on the Statistics button there would be a label showing which is higher and lower. We HAVE TO USE FOR AND NEXT STATEMENTS.
View 7 Replies
Nov 5, 2011
How can i implement a statement with if for this number to be greater than 0 but less than 10? More Specifically where would the < 10 go?
Quote:
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
[code].....
View 12 Replies
Dec 20, 2009
is there any way to use 2 for every.... statements?
i want to load up my.settings and 1 list will make new toolstripdropdownitem and the other lists is for the tooltiptexts
or I could do it another way, but how can I check the index of items in a my.setting string collection? like if I want to get the text of index number 3 how do I do that?
View 4 Replies
Sep 12, 2010
I have datagridview, wich have 5 columns
example:
id supplier bought payed sum
1 a 15
2
2 a 20
[Code].....
View 3 Replies
May 8, 2011
i have an issue with my program. when i create a function and use a calculation in it it returns a wrong answer. if i copy the calculation and put it directly in the btnClick event it works ok. is this normal?
here is the code if you would like to try see what i am doing wrong.
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
[code].....
View 6 Replies
Aug 21, 2010
I'm having trouble with a calculation in VB and it's a simple one but for some reason I keep getting an output of zero.
Here's the code for the calculation and the click button:
CODE:
View 5 Replies
Apr 15, 2012
i have this problem on how to calculate the amount due in our system in VISUAL BASIC.NET .in returning module, (this is for penalty purposes), if the borrower didn't return the book on time, the system must automatically generate the amount due .one daY is equivalent to 10(ten) pesos.so if the borrower didn't return the book with 2 days. the amount due must be 20.00 pesos.
View 6 Replies
Jan 5, 2011
I have two money fields in a SQL database called TotalClaimed and PartialSettlementAmountRecd.They are declared as Decimals like so:
Public PartialSettlementAmountRecd As Decimal
Public TotalClaimed As Decimal
They both output the repsective amounts perfectly. I need to do a calculation on them, by subtracting PartialSettlementAmountRecd from TotalClaimed. I have tried the following, but it just outputs a random number, not the amount I require.
Dim NewSettAmount As Decimal = (ClaimDetail.TotalClaimed) - (ClaimDetail.PartialSettlementAmountRecd)
Response.Write("New Settlement Amount: £" & NewSettAmount)
View 3 Replies
Jul 20, 2010
Basically if i wanted my controls to be checked at startup id use a setting obviously
'UI Settings
chkCloseToTray.Checked = My.Settings.CloseToTray
chkAlwaysShowSystemTrayIcon.Checked = My.Settings.AlwaysShowTrayIcon
[code].....
View 3 Replies
Oct 31, 2011
how to combine this 2 statment..
IsConnected("Select * from manager_table", False)
Call Loader()
IsConnected("Select * from Clerk_table", False)
Call Loader()
i hve 2 listview, 2 table from accessdatabase..i put listview in tabcontrol..1 in tab 1 & second in tab 2...
View 1 Replies
Feb 1, 2012
I found this thread in regards to calculating CRC16 on an array.... however, it does not work probably because it was written for VB6 and not .NET. [URL] Does anyone know of a built-in function in .NET to calculate CRC16? If not, is there a way I can adapt the above VB code example to work with Visual Studio 2010?
View 12 Replies
Oct 24, 2011
I need to know if this particular block of code will work, and if not, what i need to do to make it work. I'm doing touchy business and i'd prefer to have it right the first time.
strsql = "IF COL_LENGTH('orders','nosign') IS NULL" & _
"BEGIN" & _
"ALTER TABLE orders" >& _
"ADD nosign bit;" & _
"END"
View 2 Replies
Mar 15, 2012
what i am trying to do is i have two textboxs which have figues in them and need the 3rd textbox to display the figure the code i am using doesnt seem to be doing anything could anyone spot it and tell me why it is not working for me
[Code]...
View 2 Replies
Mar 17, 2012
i am trying to do is i have two textboxs which have figues in them and need the 3rd textbox to display the figure the code.[code]I want the answer doesnt display in the textbox as i want it but when i click on the text box nd type anything the answer shows but in the error
View 6 Replies
Dec 15, 2011
Develop an application which reads two integers n1 and n2 from the user via two textboxes and displays in a label the sum of the factorial of the integers n1 and n2?
View 3 Replies
Jun 9, 2011
I'm writing a financial calculator. I know that my calculations are more precise when Decimal format is used. But when I calculate 314/365, the answer given by VB is 0.8602814581, where as the real answer is 0.8602739726. This ends up affecting my calculations quite a bit.
View 7 Replies
Sep 21, 2011
How do I make an OR Statement.
Im trying to do this
name3 = [name2].EndsWith("," Or "." Or "?" Or "!" Or ";" Or ":")
View 1 Replies
Apr 13, 2012
I just wanted to know if it's possible to get an if statement to accept two strings into the same text box. An example of my code so far is below: (although please note that the program does not accept the strings after the "Or" boolean)
Private Sub btnpreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpreview.Click
If cbox2.Checked Then
[code].....
View 5 Replies
Jan 27, 2012
I am trying to perform a simple multiplication in vb.
Below is my code:
Dim minus As Integer
Dim minusPrice As Integer
Dim totalPrice As Integer
[Code].....
View 4 Replies
Jun 27, 2010
Okay I need two blocks of code for each of these:[code]Now both of these are under the if statements checking if the startsWith or equalsIgnoreCase check boxes are checked. (Only one is under the corresponding code not both.) At runtime when I check off the boxes neither of these two code blocks execute.
View 4 Replies
Mar 17, 2011
Here is my code as I have it
Code:
Public Class Form1
Dim OpePro(7) As String
[code].....
View 8 Replies
Aug 25, 2011
I have an array of characters. Depending on the number selected (between 1 and 30), the program selects random characters and concatonates them into a string. Kind of like how I think a password generator would work.I want to update a progress bar to show how the operation is going, but I need to reserve 20% of the progress bar for some actions before this, and the last 10% for the actions that follow it. So there is 70% available to use. My question is:If I set the progress bar to 20% and do the following math: 70/NumOfChars, then use a for loop to add the result of this to the progress bar (pb+=result), why does the total progress NOT EQUAL 90%!
View 1 Replies
May 3, 2011
I'm having some problems getting a query to run based off another query. Here's the database diagram to give a little background. The primary keys for all the tables are automatically generated by identites. The first 2 insert statements (Donation and Food_Donation) work but I can't get the last insert into Donation_Details to work. Here's the code so far:
View 2 Replies
Sep 8, 2011
I cant really find any good sources for connecting to a database via connection string and executing prepared statements. Could someone show me an example or point me to a resource that might be useful?
View 2 Replies