Calculate Values From Formula?
Oct 11, 2011Using VB.Net (Windows Application)[cod]e...
f1 = a + b * c means i have to pass the value a = textbox1.text, b= textbox2.text, c = textbox3.text
Using VB.Net (Windows Application)[cod]e...
f1 = a + b * c means i have to pass the value a = textbox1.text, b= textbox2.text, c = textbox3.text
I use the following columns stored in a SQL table called tb_player:
Date of Birth (Date), Times Played (Integer), Versions (Integer)
to calculate a "playvalue" (integer) in the following formula:
playvalue = (Today - Date of Birth) * Times Played * Versions
I display upto 100 of these records with the associataed playvalue on a webpage at any time.
My question is, what is the most efficient way of calculating this playvalue given it will change only once a day, due to the (today-date of birth) changing? The other values (times played & versions) remain the same.
Is there a better way than calculating this on the fly each time for the 100 records? If so, is it more efficient to do the calculation in a stored proc or in VB.NET/C#?
It's possible to calculate a string that has a formula something like:
dim val as integer
dim formula as string = "(5/1.5) + 10"
val = formula
And the result should be 13.33
I have a text box for user key in a formula,like '1+3-5',and i need to solve and display the answer.
Also need to handle the brackets,like '9+(2*4)'.
Operation is plus,minus,multiply,devide.
I have the following columns : (Using Excel Formula)
A B
------------------------
1 | Date | Value |
------------------------
2 | 8/20/2011 | 92.8 |
3 | 8/21/2011 | 92.4 |
[code]....
I want to calculate the difference between 1st Value (B2) and last Value (last populated row in column B)
Edited :
Using formula : =B2-B6 is not what's required. (I want diff in Cell C2)
I want when the user enters the value in B7 it automatically shows the difference between B2 and B7, when he populates B8 then it shows the diff between B2 and B8 and so on.. I don't want some direct method to do this in Excel and not by iterating all values to check the last value.
I'm trying to create a calculator that does this formula : Amount=Principal*(1+InterestRate) The point of it is to Calculate the compound interest earned over however many years the user selects between 1-15 from a listbox. The user also inputs the investment & interest rate. When calculate is clicked the results show in another listbox below.
year 1 $$$$$$
year 2 $$$$$$
etc
[Code]....
I stopped the code at Year 2 as it repeats the ElseIf to EndIf unitl selectedIndex = 15 & intYear 16.
it works for Year 1 but the problem comes with Year 2-15. it needs to take the value from the previous result in lstOutput and use it in the formula for principle.
i am currently making a project which is to make a cinema screen booking system. Im a beginner of course`*My main problem is that although i have most of what is working i need to find a formula to give the full result (overall price) in a label.*My other problem is the fact that when i interact with my form certain things dont auto refresh when i change certain values e.g i change number of seats but it doesnt auto refresh the price from times1 to times2. OR i click one discount radiobutton which works then another after but nothing changes and it keeps the first radiobutton's value.Okay in my menu i have a ComboBox (ComboBoxScreen) for choosing the film and there are 3 films to choose from in the drop menu each with their own price.I also have a Textbox (NumberSeats) for inputting a number of seats you want to book for the chosen film.And lastly there are 3 radio buttons each with different discounts.. e.g No discount, 10% off and 25% off. If selected each gives discount to full price.A formula to work out the overall price uses all three functions/tools above.My current code for the combobox and radiobutton part is as follows: [code]
View 1 Repliesi am currently making a project which is to make a cinema screen booking system.My main problem is that although i have most of what is working i need to find a formula to give the full result (overall price) in a label.
My other problem is the fact that when i interact with my form certain things dont auto refresh when i change certain values e.g i change number of seats but it doesnt auto refresh the price from times1 to times2. OR i click one discount radiobutton which works then another after but nothing changes and it keeps the first radiobutton's value.Okay in my menu i have a ComboBox (ComboBoxScreen) for choosing the film and there are 3 films to choose from in the drop menu each with their own price.I also have a Textbox (NumberSeats) for inputting a number of seats you want to book for the chosen film.
And lastly there are 3 radio buttons each with different discounts.. e.g No discount, 10% off and 25% off. If selected each gives discount to full price.A formula to work out the overall price uses all three functions/tools above.My current code for the combobox and radiobutton part is as follows:
QuotePublic Class txtSeats 'name of form of which is being used'
Private TEN_DISCOUNT_Decimal As Decimal = 0.1D
Private TWENTY_DISCOUNT_Decimal As Decimal = 0.25D 'percentages?'
[code]....
Where FilmCost is the price of each individual film (one is £4.25 shown above)OR lblCost is filmprice times seats.Where TotalDiscount is the discount worked out.Where TotalCost's is a value that can be shown in a label as the overall price.
I'm in need of some help trying to figure out the RegEx formula for finding the values within the tags of HTML mark-up like this:
<span class=""releaseYear"">1993</span>
<span class=""mpaa"">R</span>
<span class=""average-rating"">2.8</span>
<span class=""rt-fresh-small rt-fresh"" title=""Rotten Tomatoes score"">94%</span>
I only need 1993, R, 2.8 and 94% from that HTML above.
Dim
Field1 as
Integer
() = {0, 1, 2, 3, 4, 5, 6, 7}
[code]....
I have to calculate 360 values, for every degree 1. I've calculated all the values but my problem now is that i have to put all of them in a graph with x and y axes that are labeled but I don't have a clue how to begin.
View 39 RepliesHow can I calculate the values in a date. [code]
View 4 RepliesCalculate Values On Datagrid?[code]...
View 12 RepliesI have text1=a, text2=b, text3=c, text4=d, text5=e
Now I want to calculate the average of the values,
Here's a simple way
average=(a+b+c+d+e)/5
But what if i have values only in 3 textboxes, that means the code will still divide the sum of the values into 5, that will not be correct!
how to calculate "InvTotalTextBox" and "InvDiscountTextBox" values then show the result in "InvNetTextBox"..?
how can i do..?
three TextBoxes in a form
InvTotalTextBox, InvDiscountTextBox and InvNetTextBox
InvTotalTextBox is Binding with Table Field "InvTotal"
[Code]....
I am trying to write a function in VB.NET that takes a value and returns it's y-position on a Bell Curve.
View 4 Repliesam trying to calculate the values in rows in column 6 based on values of column 5. Bellow is the the code I am using I get a run time error about the string not formatted properly
[Code]...
How to display/calculate matching values to text boxes in (Service Details Group) and transfer/calculate it all to Rich Text Box (TOTAL $)
View 4 RepliesI'm trying to calculate an average no from data imported from a text file using streamreader. I'm not sure how the loop should read, and the result (average) I want to hold in a separate variable for future use.[code]...
View 1 Repliesi am doing a small project for my business and i got stuck with this 2 weeks ago and still no progress.
I have an access db table "store" that has columns: (filldate,brand,model,plateno,mileage,litres) where i am storing these info each time a car in my company fills gas. For example (8/25/2011,Renault,Megane,5487844,3943,20).
What i want to do now is to display in a datagrid the total consumption of gas (litres) with the kilometers driven (mileage) between 2 dates.
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
End Sub
[CODE].......................
In the discussion in this thread: [URL] it was reveiled to me that vb.net, using double, could only calculate values up to 18 digits after decimal.... so I started thinking and came up with this class
Public Class LargeNumber
Private pNumber As String
Public Sub New()
[CODE].............
I want to split the string into a series of doubles.... and than combine them into a large number.... The size of each double component should be 18 digits on a 32 bit computer... so that I will have room to add the last carrier...
To pass decimal values to radio buttons so I can calculate an output answer. it is a tip calculator. I am using radio buttons as options to choose what amount to tip, ie. 10, 15, and 20%. I need to figure out how to pass the value to the buttons in code so I can calculate the tip amount.
View 1 RepliesI am writing a pizza order program for class and have gotten everything put together, even got my array setup and displaying but when i go to calculate it will not calculate the values coming from the array in any of the calculations.
[highlight="vb"]Option Strict On Public Class Form1 'declare structure and module-level variables Structure PizzaSale Dim SizaString As String Dim StyleString As Stri]
I am trying to calculate the number of years for my calculate age event handler, however i am apparently missing a method or whatnot because im trying to calculate the age , can anyone suggest help on this. I need to subtract years to get my age but when i try the birthdate.Subtract (currentDate) method i get an error about not able to convert from LONG?
So below is what I have.
Private Sub btnCalculateAge_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculateAge.Click
Dim currentDate As Date
Dim BirthDate As Date
Dim Age As Long
[CODE]
check the attached 2 file. one is .docs file another is .bmp file. Problem is that i want add that formula in database through vb.net. what will be data type in sql serve? and how to manage in vb.net??
View 1 RepliesI am reproducing a program written in C to vb.net and I am getting different results on a math formula. I am sure it is something simple that I am overlooking. Here is the formula in C
num = (10 * 9 * 80900 * 0501) & 0xffff;
Here is the same formula in vb.net
num = (10 * 9 * 80900 * 0501) AND &HFF
how to generate the formula. want to use arraylist to store and for loops to loop the formula til the system can detect which staff it should giv the ticket to..below is the scenario:this is a helpdesk system..so each ticket they submit muz be auto assigned to a staff to attend their ticket..each staff has a different quota..so i came out wid this algorithm on hw to determine who the ticket shld go to..
for ex: i set one ticket's quota is 7%
staff A's quota - 47% staff B's quota - 35% staff C's quota - 18% so to knw how many tickets A get den B getx 1 ticket and how many tickets B get den C gets 1i came out wid a calculation like this -
Staff A - 47% / 7% = 6.7(max no.of tickets he can receive foe a period of time)
Staff B - 35% / 7% = 5
Staff C - 18% / 7% = 2.5
so first i compare A&B whr i took 6.7/5 = 1.3 -> so every 1.3 ticket A gets,B gets 1 ticket den i compare B&C whr i took 5/2.5 = 2 -> so every 2 ticket B gets,C gets 1 ticket i wanna implement this concept in my code..but i dunno how to come up wid this formula..
First the requirements: By management requirements, I can't use open source code. I need the users to define their own formulas for a project. My users don't know how to code. The formulas need to be saved somehow, and being read later. I need to debug the formulas written, so I need to be able to see and understand them. The formulas used are quite specialized and specific (actuarial formulas). Adding new formulas (functionality) must be done in fast and maintainable way.
[Code].....
I need a code that will convert decimal to binary. My current code doesn't work and just crashes, any suggestions on what I should do
For i = 1 To 17
Me.lstDec.Items.Add(i)
[code].....