An Algorithm Which Can Calculate 500 factorial?
Aug 25, 2007can you write an algorithm which can calculate 500 factorial.scientific symbol(mode) is unauthorized.Answer should be in String mode.
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 Repliescalculate 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.
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.
I am trying to implement an Algorithm called "Diamond-Square Algorithm" I am having trouble ending it so that it retiurns the required result. So far I have the folloiwng.
[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 Replieshow to find factorial
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]...
This is a math calculation which is using factorial.
[Code]...
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]
Private 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'll do my best to explain what the algorithm is supposed to do:There's a class 'Recipe'.ach Recipe can include other Recipes but cannot include itself or any other Recipe that includes it. So, a simple example is we have just two Recipes A & B.A,B,C(1) Recipe C Adds B(2) Recipe B Adds A(3) Recipe attempts to add C, but can't because of the relationship. C- B - A.
View 4 RepliesI'm Micah. Electrical/Electronic engineering 500 level student. I'm working on my final year project. please i need a code for the implementation of RSA algorithm in VB.NET. your assistance will be appreciated.
View 2 Repliesis the algorithm for VB editor released anywhere? because i'm trying to create my own editor that gives various options like Linking and self defined array functions (see below) such that one edit can update several others in various places, but i do still wish to have the auto formatting VB editor provides us with.an example of a self defined array function (count):we can transform this:
Public Class test
Private Shared number_of_methods As Integer = 2
Public Function get_number_of_methods_juz_an_example() As Integer
Return number_of_methods
[code]....
well of course instead of the code it would be just click and select (i wrote out the code in <> just to show what's happening)
i need some tutorial to implement BLS (Boneh-Lynn-Shacham) signature algorithm to create private key and public key to encrypt a message.I need tutorial to implement this in VB.NET.
View 1 RepliesI found an algorithm in C# that I need to convert to C. Problem is, I have never used C# so the syntax is really strange to me.
Implementation of Berlekamp-Massey algorithm for calculating linear complexity of binary sequence
s = byte array with binary sequence
returns Length of LFSR with smallest length which generates s
[Code].....
I want create my own algorithm
View 1 RepliesHow would I be able to use my own Encryption Algorithm in my program such as encrypting text. I havn't been able to figure this out.
View 1 RepliesI am using VB.NET and I am trying to come up with some algorithm or some pseudo-code, or some VB.NET code that will let me do the following (hopefully I can explain this well):I have 2 collection objects, Cob1 and Cob2. These collection objects store objects that implement an interface called ICob. ICob has 3 properties. A boolean IsSelected property, a property called Length, which returns a TimeSpan, and a Rating property, which is a short integer.
OK, now Cob1 has about 100 objects stored in the collection and Cob2 is an empty collection. What I want to do is select objects from Cob1 and copy them over to Cob2. I want the following rules obeyed when selecting the objects though:
[Code]...
[code...]
So far, my friend has this, and we're trying to figure out how to get the code to tell convert F to C, and back. All we can use for input is (example:) 10,f and it will change it to 40,C.
Forgive me if this is a silly question....but I think back to my Comp. Sci. classes and I distinctly remember learning/being quizzed on several sorting algorithms and the corresponding 'Big O' notation.
Outside of the classroom though, I've never actually written code to sort. When I get results from a database, I use 'Order By'. Otherwise, I use a collection class that implements a sort. I have implemented IComparable to allow sorting; but I've never gone beyond that.Was sorting always just an academic pursuit for those of us who don't implement languages/frameworks? Or is it just that modern languages running on modern hardware make it a trivial detail to worry about?
Finally, when I call .Sort on a List(Of String), for example, what sort algorithm is being used under the hood?
I'm trying to convert the following algorithm from C# to VB.NET and the VB.NET I have is not producing the same results as my C# algorithm, can someone tell me where I've gone wrong in my conversion?
public static IEnumerable<T[]> Combinations<T>(this IEnumerable<T> elements, int k)
{
List<T[]> result = new List<T[]>();
[code]....
I need to encrypt vbs file using a cryptographic algorithm. I read about converting it into vbe file, but is there any other way to do it?
View 1 RepliesI have visual studio 2008, and we have been given specific tasks to carry our for our course, we have been asked to implement euclid's algorithm by using a while loop, doing so without the visual part of visual basic whatever that means an example of a question they gave was 1)HCF(88,26)=2 how I would go about doing this, as I am thoroughly confused, and deadlines are fast approaching.
View 3 RepliesI have some text files that contain
<img width="100" or
<img width="1400" or....
How could i replace all above with the following, since the image width is not static?
<img width="200"
i am working on project of using ant colony optimization and espcially on antnet algorithm but i have many problems in programming of this algorithm, and since i dont perfer using simulation for that purpose.
View 4 Repliesi want to implement bankers algorithm in vb.net how can i implement it
View 1 RepliesI am struggling to write a sorting algorithm that can sort characters in a word lexicographically (alphabetically) as follows
lexicographical sort of the word :- Contamination
lexicographically
Sorted Text Index
[code]....
write a pseudo code / or an implementation in C# or VB.NET of how I can do a lexicographical sort of the word above?