VS 2008 Math Calculation Which Is Using Factorial
Aug 15, 2009This is a math calculation which is using factorial.
[Code]...
This is a math calculation which is using factorial.
[Code]...
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 RepliesI 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].....
I use Math.Tan(str) for example (str = 35)
I become 0.47... But how can I calculte it in Deg., and Grad., to?
how to get the mantissa and exponent from a double in VB.net? I know I can do a string parse and some conversion to ints but I wondered if anyone had a mathematical equivalent formula that would allow me to do this?
View 1 RepliesI have a program that scans an image and converts gems to specific numbers. Look at the picture below:So i have a table with numbers. Number 1 is for yellow gem, 2 for blue, etc...
Like:
A B C D E
1 | 1 2 3 4 5
2 | 3 5 2 4 1
[code]....
I want to calculate a step, to get 3 equal numbers (gems) horizontally or vertically. For example, in this table if i swap E2 with D2, D2 will be 1, and D2,D3,D4 creates a valid step, because it's all 1. I'm using VB.NET 2010.My table is 8x8 size, it's just an example above.At now i'm just have the values in multiple variables (A1=1, A2=3, so on..)
So I need to get a button to take the number that a user enters into a textbox, calculate the factorial from that number, and display it in another textbox. I can't seem to get this to come out right.
Here's some of the code I've been playing with.
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Function Factorial(ByVal txtFactorial As Decimal) As Decimal
If txtFactorial <= 1 Then
MessageBox.Show("Enter a number greater than 1")
Else
txtAnswer = Factorial(txtfactorial - 1)
End If
End Function
Now I have to just work out the code part. Can a function be under a button? I'm getting an error about that. I'm also getting an error about the txtAnswer=Factorial(txtfactorial-1) part of the code.
well i am having a couple of issues with this particular homework problem and this is my first programming class so there is probably quite a few mistakes well the homework problem is to take three double values entered by a user and display the largest and smallest using math.max and math.min and display the smallest and largest so i thought i could use a listbox and take the values that went to the listbox and assign variables to each so i can try to use each variable in the math.max and min but im not making it to far and i actually might be way off
[Code]...
I need to store a calculation to use later and obtain a new calculation
[Code]...
I understand the concept of rounding I guess, all I know is math.round(), but I need a break down of it so I can round a number like this: 14.789543 to this: 14.8 because after the 7 there is an 8, which means you would round the seven up. Can anyone tell me how this is done?And some more detail, I need to round to the nearest tenth.
View 9 Replieshow to find factorial
View 1 Repliescan you write an algorithm which can calculate 500 factorial.scientific symbol(mode) is unauthorized.Answer should be in String mode.
View 1 RepliesTrying to figure out how to calculate factorials via loops. Cant seem to figure out where to start when using loops.
View 9 RepliesNeed to take the number from a textbox and get the factorial
Public Class Form1
Private Sub btnCalculate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
[Code]....
Imports System.Numerics 'have to add reference Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]...
Why my math keeps getting rounded to 0 decimal points by default?When I do this I get return value of 1
Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim numb1 As Integer
numb1 = 100 / 78
MsgBox(numb1)
End Sub
How to get that value up to two decimal points (like 0.00)?
calculate the factorial of given number using recursion.input the number in textbox and show the
result in another textboxrajeev ranjan, on 29 March 2010 - 12:38 PM, said:calculate the factorial of
given number using recursion.input the number in textbox and show the result in another textbox.
I have a form with 10 math questions. Beside each question there will appear a check mark if it is right and a X if its wrong. I also have a label that will display a score in percentage. If 2 are right then it will display 20%. If they are all right then it displays 100%. My problem is ...how can I code the event. I thought of case select, but that would mean 100 cases to make it work.( If check1 and check2 are visible then display 20%, but if its check1 and check 7? Thats alot) What I want ot know if there is an easier or shoter way to ontain the same result. I am working with Visual Basic 2008.
View 7 RepliesI have a date stored in my MS Access DB as "ShortDate" (dd/MM/yyyy).I need to read this date and compare it with "current date - X days". Where X days is a Value saved by the user (into another form 5, 30, 60 days... etc).In the short way: If "Current Date - 55 Days" it's equal OR in that interval of "DataBase Date" then MessageBox.Show("Warning!!! Expiring in {X} Days")
View 1 Repliesif the current hour is less than 21:00 (today) then show the remaining time in label3 as hh:mm:ss remaining. However, if the current hour is greater than 21:0
View 6 RepliesDim d1, d2 As DateTime
d1 = DateSerial(2009, 2, 29)
d2 = New DateTime(2009, 2, 29)
for some reason i thought the two statements would generate the same date, but they don't. i found this out when trying to do age(years / days) calculations. if you are born on a leap day, i.e. 2/29/2000, dateserial is useful in that in non-leap years it correctly identifies your birthday as 3/1.
How do I add 2 text boxes together textbox one = $20 and textbox two = $40 and text box 3 adds both textboxes together to display = $60?
View 3 Repliesi have three text boxes that the user will input numerical data into to determine the area of an object. i need the result of my calculation to be displayed in a label but i cant figure it out.
View 2 RepliesI am trying to write the following application. A project has initial investment, yearly revenue and yearly expenses. The program should be able to take these data and calculate the break-even year, i.e. when the cumulative profits become 0. Also, it should have a listbox that would list the cumulative profit for 10 years. Refer to the example below. Now I know how to show it in the listbox but I am having trouble showing the break-even year. I know how to calculate it but how do you show it in years.
View 8 RepliesI have an application that has 3 list boxes, one selects a workshop, the other a location. the third is to display selected costs.to do the calculation a loop is required. i have written the code but when i calculate the cost the final result to be displayed ends up as being the cost of the last work shop and location * 3,What is supposed to happen is the location is multiplied by the number of days(3 in this case) and added to the workshop cost.the loop is supposed to add all cost from the list box till all have been added.what is happening is the calculation goes to the last entry as stated the multiplys this total by number of days(dbl)?
View 1 RepliesPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click.[code]the program enters a number and display its factorial, our program has error, eg. if your going to input 7, the result would be {num1}5040.we are having difficulty in its result... the required output should be 1*2*3*4*5*6*7=5040
View 1 RepliesCan someone explain to me what the difference is between a recursive function and a factorial function. I know that a factorial function returns the product of all the numbers from 1 to itself. But how does that differ from what a recursive function does
View 2 RepliesI,m developing a debt calculation program 'my problem is when i have to calculate the months to pay back the debt it comes to 28.04 and i have to get it to 29 my code looks like this:
[Code]...
How can I round 4.39 to 5 in VB.NET? I tried:
Math.Round(4.39, 0)
But it displays 4.
I've been having a problem with Math.Log in a function I'm trying to write. When working with variables, it always returns 0. Here's the line I'm trying to run:
Quote:
mb = txtMb.Text
k = txtK.Text
t = txtT.Text
[Code].....