Compounding Numbers Formula/loop/equation ?

Nov 26, 2009

I am trying to make a loop to calculate the total costs for 12 days of costs. It has to compound sort of though. I need the total = cost for day 1(includes day 1) + cost for day 2(includes day 1 and 2) + cost for day 3(includes day 1, 2, and 3).....up to day 12. I have a for/next loop in my array, but it calculates the total for 12 days, but I need it to add as explained above. I have been strategizing and the program needs V= day 1 then add V to T. Then V needs to clear and then loop again so V=day 1 + day 2 then add V to T. Then V needs to clear and loop again so V=day 1 + day 2 + day 3 then add V to T and clear V.........up until all days are added together. If anyone has any suggestions or any idea of what I am talking about please comment! Here is the link to another forum that might explain the program in more detail:

Here is the code for my program so far:


VS 2005 Extract Input - Can't Use The Equation To Add Two Numbers

Jan 4, 2010

I know how to read input numbers, but when I input equation like A+B, I can't use the equation to add two numbers. I tried many times but failed to use the equation.

Here my

Public Class Form1

Dim Number1 As Double
Dim Number2 As Double


View 2 Replies View Related

Formula Or Convention When Dealing With Inclusive Numbers

Oct 3, 2010

I addressed a meeting and used the following....she worked there for 17 years.I was corrected later that it should have been 16 years.I argued that the first year of this persons employment was 1966 and her last years work was 1982. Therefore 17 years.Does someone have an articulate mathmatic reasoning that explains dealing with inclusive numbers.

View 12 Replies View Related

VS 2010 : Use Regex To Check If The User Add The Numbers Of Phone In This 'Formula'?

May 3, 2012

I need to use regex to check if the user add the numbers of phone in this 'Formula'

must the number start with '09'
must the number contains '10' characters'
must the numbers seperated by Comaa ','

View 4 Replies View Related

How To Add Numbers With A For Next Loop

Apr 14, 2009

I cannot seem to make my for next loop work for a class project. Essentially, I have a list box that is populated with strings of numbers. I am required to use a loop to sum the total of the numbers in the list box and display them in a label. I chose to use a For Next loop. However, it's not working. I'm getting an error when I try to convert the strings to decimals.[code]

View 12 Replies View Related

Collecting Numbers From A Loop?

Jan 31, 2012

I am trying to get the numbers from a text field .the format of the text field is ##d##+## (number sighs represent actual numbers)[code]....

View 1 Replies View Related

Implementing Radio Buttons - Select One Of Them To Use One Formula, And Then Select The Other To Use Another Formula

Feb 20, 2009

I want to place two radio buttons in so I can select one of them to use one formula, and then select the other to use another formula. I want to use the I=P(1+r)^n formula and I=P(1-r)^n formula with the radio button text showing Appreciation and Depreciation.

Heres my copy of the original code.

Public Class Form1

Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
End Sub


View 5 Replies View Related

Adding Numbers To Text (for-next Loop)?

Jul 11, 2009

I have a text file (*.txt) with a name in each line, like this:


Now I want each name added with a number from 1 to 99.

Like this:



I have folowing code:

For n As Integer = 0 To (numbernames) - 1
strContents = objReader.ReadLine()
For i As Integer = 0 To 100 - 1


With this code all happens ok and a new text file is created with the desired name-list with added numbers.The only problem is that the last name doesn't get a number added from 0 till 99 but for example 0 till 17.

View 6 Replies View Related

Loop Displaying Prime Numbers?

Jun 20, 2012

I'm having a serious brain fart over this but I need a looping statement that will display all prime number from 6 to 10000.

View 3 Replies View Related

Next Loop - Pseudo Code - Sum Only The Even Numbers

Feb 11, 2011

Write the pseudo code needed to sum only the even numbers from 1-n, where n is a value given to you by the user

And I have something like this:

Dim x as integer
n = txtUserNumber
For x = 1 to n Step 2
Total+= sumofnumbers

View 4 Replies View Related

Loop N Numbers Of Record At A Time In A Dataset?

Oct 19, 2011

I am trying to loop through a dataset and process n numbers of records at a time.For example lets say I have around 240 records in my dataset. I need to loop through the dataset and then create a new batch of 50 records. so for the dataset which has 240 records I want to create 6 batches. Out of these 6 batches, 5 would have 50 records and and last batch would have 40 records.

View 1 Replies View Related

Loop SWF File Using Specific Frame Numbers?

May 27, 2010

how to loop an SWF file using specific frame numbers. I don't want the SWF file to play thoroughly. I know that frame 1 in Flash is 0 in VB, frame 2 in Flash is 1 in VB, etc.

View 5 Replies View Related

Loop To Count And Accumulate Numbers Does Not Work?

Mar 23, 2011

My loop that needs to count and accumulate the numbers from a list box does not work.  When I debug it reads the first line of the Do While loop then jumps to the code where it would average the numbers.  Here is my code:
'calculate average
'get first item in list box
lstListBox.SelectedIndex = 0


View 3 Replies View Related

Fibonacci Numbers Loop And Output To Multiple Labels?

Mar 29, 2011

I have attached the form in initial state. What you don't see in the initial state is 10 hidden labels. I want the loop(which I am calling as a function??) to compute the numbers and display in the labels. Example, if I input 1 for the first term, 3 for the second term and 4 for the total terms, the first 4 labels should become visible and have in them one solution each:

1 - 1
2 - 3
3 - 4
4 - 7

Am I way off with what I want to do? Cannot use arrays, must be a loop.This is the compute button:

Private Sub BtnComp_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles BtnComp.Click


View 10 Replies View Related

Loop To Search For Duplicate Numbers Within A Column In A Database?

Nov 28, 2011

i have wrote a loop to search for duplicate numbers within a column in a database which i have got fine but when i find a duplicate i would like to get the all of the row so if 33 was a duplicate i would like to get the following row.


I have tried to do this buy use something i saw on msnd's website:

Dim foundRow() As Data.DataRow = customerDS.Tables("Details").Select("HNCNO Like '33%'")

However if i change the line to notice the i beside the like

Dim foundRow() As Data.DataRow = customerDS.Tables("Details").Select("HNCNO Like 'i%'")

but i get Index was outside the bounds of the array. Ok i know that means that there is nothing in my array. What i would like is to find the duplicate row associated i. you will probably understand me better when you see the code.

Private Sub checkRowsForDups()
Dim customerDS As DataSet
Dim dupArray As New ArrayList


View 9 Replies View Related

Out Of Memory Exception / Parallel.For Loop / Large Numbers?

Nov 27, 2011

I need some guidance on a little program I'm making (one that I thought would take a couple of hours from start to finish, it's been days now ...) that determines all of the proper divisors of any given number up to the maximum value of a UInt32.

View 8 Replies View Related

Add A Loop To Allow Repeated Checking Of ISBN Numbers And Select Case

Oct 16, 2009

I need to add a loop to allow repeated checking of ISBN numbers, which should check to determine when processing should be ended and should allow exiting the program without having to enter an ISBN before quitting. I also need to use a Select Case for the three ISBN possibilities (ISBN-10, ISBN-13, invalid ISBN length).


View 10 Replies View Related

Clean Up Code - Use A For...Next Loop So Can Fill A Text Box With Sequential Numbers

Sep 10, 2011

I've got Visual Studio 2010 and I am looking to clean up my code technique, since I've taught myself and now I'm taking classes.

I'm trying to use a For...Next Loop so that I can fill a text box with sequential numbers. For some reason, all I can get in the text box is the last number and I feel that at this point I'm probably overthinking it...

All I want is on the button push the text box shows:

Here's what I have:


Once I grasp this simple concept, I can move on to the actual challenge ahead of me, but I really want to know the proper way to handle this with out going all spaghetti code.

View 7 Replies View Related

VS 2008 - Make A Loop From 1 To 100 And Make It Everytime It Loops Display Incrementing Numbers To The Screen?

Aug 23, 2009

How do I make a loop from 1 to 100 and make it everytime it loops display incrementing numbers to the screen?

View 1 Replies View Related

Iterate Through An Equation?

Apr 26, 2012

I want to iterate through an equation and modify a number e.g. Multiply it by 10, where there is one. How do I do this?

View 4 Replies View Related

User Equation N Value

Mar 11, 2010

I wanted to read input equation by user A+B and assign input user value to A and B to ask them to add and give answer. But I just can't get the code to work. I using VS2005 and VB.Net.[code]

View 1 Replies View Related

Using Function For More Than One Equation?

Apr 26, 2011

Can I use a function for more than one equation?

Program Description: Fortuitous Dice is a game that requires two dice be rolled, one at a time. If p and q are the numbers rolled on the first and second die, respectively the value of the roll in the game is determined as follows:

P Q Rule (value of the roll and condition)
Even Odd 2P + Q
Odd Even P + 2Q
Even Even P + Q When P not = Q
P When P = Q
odd Odd P + Q  When P not = Q
3Q When P = Q

View 12 Replies View Related

Evaluates Loop Condition In Do...Loop Statment To Determine Whether Loop Instructions Should Be Processed

Mar 14, 2011

Makes the following statement about the code below:

**"The computer evaluates the loop condition in the Do...Loop statment to determine whether the loop instructions should be processed. In this case, the inputsales <> String.Empty condition compares the contenst of the input sales variable to the String.Empty value. As you know the String.Empty value represents a zero length, or empty, string if the inputsales variable is empty, the loop condition evaluates to True and the computer process the loop instructions. *If on the other hand the inputsales variable is not empty, the loop condition evaluates to false and the computer skips over the loop instructions.

Based on the code I think it is the opposite: ...that while the inputsales value is not empty it should evaluate to true and process the loop and if it is empty it should evaluate to false and skip the loop?

See below.

Option Explicit On
Option Strict On

Imports System.Globalization


View 2 Replies View Related

Equation With Multiple Possible Results

Jul 30, 2011

I have a decent understanding of the logic, the content. I'm working on a puzzle and I'd like to write a short program. I'm looking to fill in the following variables: AB.CDE FG.HIJ (they're part of coordinates, and the puzzle is part of a geocache)
The puzzle asks you to determine which numbers correspond to certain colors, like this:


I need to define A-J as >= 0 and <=9. I also need to say that each color is >= 0 and <=9, but that no color can be equal to another color (purple ≠ yellow, orange, etc). some number combinations won't work. Purple and yellow can't be 2 and 5 respectively, because that'd produce a negative number. I'm guessing that there will be more than one possible result. So how do I create an equation that calculates this.

View 15 Replies View Related

Convert String To Equation?

Apr 14, 2009

I would like to read a user's input equation or expression as a string (such as "y=5*(x+6)" or "cos(3)^2") and have the program evaluate it mathematically.   Does .Net have any classes that could do this?  Obviously, the compiler can already take a programmer's coded equation and evaluate it. Of course this is a different matter, but is there not a way to harness that same power with runtime user-created equations?  Serialization or anything?

The other option (I guess) would be to create my own equation-generator - breaking an equation down into a binary tree of the numerical values and the operations I suppose.  Aside from being a nontrivial task, my program needs optimal performance as these equations are in large loops.  At the very least, this would add several conditional evaluations to each equation run - dunno if that adds up.

View 8 Replies View Related

How To Make An Equation With Timer

Mar 16, 2010

The project is "kWh counter", that is, a simple program that calculates the power usage.The incoming numbers are the Power of the appliance (lightbulb) and the voltage (230/120).The formula is W=P*t that is multiplication of the power and the time it is used.I thought to connect it with a timer and the passing secconds multyply with the power, and, write the ussage on a label.This would be something like a simple digital power counter.Note that the voltage is not necesary.I am from europe where the standards are 230V.

View 7 Replies View Related

How To Solve An Equation That Is A String

Feb 9, 2011

I have an equation in the form of a string:

Dim Answer as Integer
Dim AnswerBox as New RichTextBox
'... Settings for AnswerBox


View 5 Replies View Related

Inputting The Radiobuttons Into Equation

Jun 8, 2011

My assignment is to get the Get Monthly Income (Num1)Get Monthly Home Rent/Mortgage (Num2) Get Other Monthly Payments (alimony, child support, student loans) (Num3) Display Allowable Monthly Car Payment Display Maximum Car Value (interest rate based on credit) (answer) Public Class Form1


View 5 Replies View Related

Use Day & Month In Simple Equation?

Mar 26, 2012

What I need to do is automatically generate a specific PIN number based on the current date. The formula goes like this: MMDD + 1234 = PIN. (ex. Date = 3/26/2012 -> 0326 + 1234 = 1560; With 1560 being the PIN number. I then need the PIN number to display as text, but that's the easy part, I really just need assistance with getting the date information in the proper format for the equation.

View 2 Replies View Related

Using MS Equation Editor In VS2008?

Nov 17, 2009

after a lot of research on formatting Maths equations, apparently using MS equation edior is the easiest way to do it. But, I have no idea how to use it in VS 2008.

View 2 Replies View Related

VS 2010 - MouseMove Equation ?

Dec 19, 2010

I am rotating a picture dependant on the mousemove.

Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove


To simplify the part I am having problems with: rotationX = CurrentPositionX + ((InitialPositionX - MousePositonX) / SlowDownDivisor)

As an example, this occurs in both X and Y; If I click and drag in the X + Direction and release the mouse button it does exactly what I want, rotation in the positive direction. If I click and drag in the X + Direction and then drag in the X - direction, the rotation continues to be positive, it doesn't reverse. If I release the button and then click again and move in the X - direction the rotation is negative as it should, but it will continue to rotate in the negitive direction until the button is release.

View 1 Replies View Related

Best Commercial DLL To Calculate Equation Of Any Complexity?

Mar 9, 2011

commercial dll to be used in to calculate equations of any complexity? pass an equation as a string form and to get the final result.

View 1 Replies View Related

Concatenate A Equation And Answer To Text Box?

Mar 22, 2011

In our school theres a programming class and the teachers gone for the week and the sub is starting to get very frustrated, so I offered to help in any way i can. I have never programmed Visual Basic but I have programmed Ms-Dos, Javascript, HTML, *.vbs, *.ahk, *.gml, and a variety of other languages.

The class is going to build a program that calculate how many rabbits are born in a family. So when they click the button it shows in a text box the actual equation and then the answer after the equal sign that where i assume concatenation comes in.Here's the code I've thrown together for when the buttons pressed:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim RabitAmount As Integer
Dim ShowEquation As String


I got the equation to answer it self and show in the text box but it won't show the equation?

View 7 Replies View Related

Display An Equation Prior To Solving It?

Jul 19, 2011

I want to display an equation prior to solving it.  Obviously in MS word etc I can use equation editor to write an equation, but I'm writing my own program.

Is there an easy way to display an equation.  Obviously I could use text to write eg as text "a=b^2-3(c-d)/5" and everyone here would have little problem interpretting what I want but I want this to be accessible to 12 year old children.

Alternatively I could try and manipulate lots of text boxes one on top of the other to try and explain what I'm doing

The third alternative I thought of was to write in equation editor export the graphic and then import a graphic.

I'm sure I must be trying to reinvent the wheel - which I believe is the one thing OE programming is supposed to avoid.

View 1 Replies View Related

Displaying The Equation And Answers In A Listbox?

Apr 27, 2012

First off the listbox needs to show the equations for the number entered between 0 and 12 example:



View 7 Replies View Related

Equation - How To Display Number 7 In Label

Feb 20, 2009

I put this mathematical formula in VB 2008 Express Form and I have the result show in TextBox and every thing is good so far and my question is if I have a table of numbers for example if the answer in the TextBox is 0.00098 and my table show :
0.0001 to 0.00100 = 7
0.00101 to 0.002 = 8
0.00201 to 0.003 = 9
I need the number 7 to be displayed in label 1 so how can I do that?

View 6 Replies View Related

Evaluating An Algebraic Equation And Getting The Answer?

Jun 19, 2009

I store a formula in the database such as the following:GrossIncome+(Overtime/0.5)-Deductions=BasicNetIncome

I am able to substitute the string representations with actually values entered, thus:1000+(150*0.5)-100=BasicNetIncome

Then I remove the '=BasicNetIncome', thus:

How can evaluate the above equation to return a result:


View 1 Replies View Related

Get Program To Re-adjust The Boolean Equation On The Fly?

May 30, 2012

I have a boolean condition that I want tthe program to recognize changes when they occur. Currently in order for the program to recognize a change I must restart the program.I have tried using a public timer but that didn't work.


D1A = File.OpenText("MEASURE UNITS.TXT")
D1B = CStr(D1A.ReadLine)


I am re-writting the text file "MEASURE UNITS.TXT" labeled (D1B). Depending on this boolean equation different options become available in other parts of the program.I need the program to re-adjust the boolean equation on the fly.

View 1 Replies View Related

How To Find Equation Of Curve Given Data Set (X / Y)

Jan 30, 2011

I am trying to write code in to find a equation when data points are given. For example (1,5),(2,6) etc. I need to find a equation(not necessarily always linear) from the given points. How do I calculate a trendline for a graph? How to get equation.

View 1 Replies View Related

Income Tax App - Adding Equation For Each Case

Jun 8, 2011

I have to create an app that computes the amount income tax that a person has to pay, depending on salary. Income tax should be calculated for each portion of income in each range.

Here are the following income ranges and taxes rates:
Not over $7825=10%income tax
$7825-31852 = 15%income tax
$31851-77100 = 25%income tax
$77101-160850 =28%income tax
$160850-349700=33%income tax
Over $349700 =35%income tax

Here is the code so far:
Public Class IncomeTaxForm
Private Sub calculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calculateButton.Click
Dim IncomeTax As Double = 0
Dim salary As Double = 0
[Code] .....
I keep getting zeros. Do I have to add another equation for each case?

View 3 Replies View Related

Copyrights 2005-15, All rights reserved