300 Topics
| |
Hello, I have this program that simplifies a fraction by calculating the greatest common divisor. So the fraction 8/4 (largest common divisor = 4) 8/4 4/4 => result would be 2/1 (fraction simplified) My problem is my method calculated this greatest common divisor. But now that value has to be … | |
how do i retrieve complex numbers (a + jb) so that just a appears in one textbox and just b appears in another textbox? | |
Hi, What is the function/opperator to calculate a power with C# I tryed [code=c] powerof = anumber ^ anothernumber; [/code] and that clearly doesn't work (1^3 is 2, 2^3 is 1 etc.) How do I do it??? I looked under [icode]Math.[/icode] functions and there was nothing and I spent ages … | |
Whenever you hear the word recursion, factorials or Towers of Hanoi are never far away. Well here they get mentioned, because we are not going to talk about these guys at all! Iteration and recursion are in fact quite similar: they both loop until a certain condition is met. As … | |
im supposed to write a code that you prompt to enter 10 different grades then drop the minimum value, while computing the average of the remaining 9. I'm getting infinity as the answer when I run the program so I know my min is messed up, somewhere but i cant … | |
Hey, I've got an assignment from my computer teacher in school. I've got to make a program that displays the prime numbers in a range and also display the number of prime numbers that are present. And i'm only supposed to use the basic header files.....that means the program should … | |
[CODE]#include <cmath> long double NR(long double sample) { return (abs(f(sample)))<=1e-10 ? sample: NR( (sample - f(sample)/fp(sample))); } long double f(long double sample) { return 2.5*exp(-sample)-3*sin(sample); } long double fp(long double sample) { return -2.5*exp(-sample)-3*cos(sample); }[/CODE] I'm trying to write code for a Newton-Raphson algorithm. I have it in recursive form … | |
Hi I'm trying to find a way to find the first avogadro cipher whose digital sum exceeds 100, I've come to: [code=python]#!/usr/bin/python def dig_sum(n): lst = list(str(n)) ln = len(lst) sm = 0 while(i < ln): sm += int(lst[i]) return sm def avo(i,j,k,c): k = j j = i + … | |
Hi guys, I am working on a conversion of the Mandelbrot Fractal from Java to C# and my programming skills are lacking quite a bit. I am desperately trying to improve but I have come across some errors that are stumping me. I have attached a txt file with the … | |
Hi, Iv had to convert a program from Java to C#, I thought I had done it, but it doesnt work, and Im at a loose end because I cant figure out why it isnt working. Anyway, what it is is a Mandelbrot Set that Im trying to display in … | |
Alright.. i figured out mostly everything but my math is still screwing me up. I need to accumulate running totals for number of checks and number of deposits ;and total value of checks and total value of deposits. Im supposed to do this by looping through my arrays and this … | |
how do i solve this problem r+5(r-2)=28 3(r+4)+5(r+2)=102 | |
i want to write a function of sign function without using system.math library in c#. plz help me how can i write this code??? | |
Hello all, I'm having some trouble with a project I am doing and I was wandering if anybody could help me/point me in the right direction. So the gist of what is happening is I have a program that is supposed to be flipping 2 coins independently of each other … | |
I'm currently re-writing a bit of code and i'm in two minds about which way to take it. Advice would be greatly appreciated :) The application is used to control a USB circuit board. The board has 32 analog outputs. The outputs are switched on and off by sending a … | |
Hi I need to format a decimal value to time and then display it in a textbox in the proper format. eg: double value = 1.25 to "1:15" I do not have a clue how to go about it Thanks | |
Hello, I need to create a function which takes parameters for a circle and checks if a given point(x,y) lies within the circle (or on the edge). Like this: [CODE]public static bool PointExistsInCircle(Double CircleX,Double CircleY,Double CircleRadius,Double PointX,Double PointY) { needs to return 'true' if the point is in the circle, … | |
I am aware that JavaScript arithmetic does not handle either really large numbers or decimals well. This is why I have made this library of functions. I am posting it here rather than under "code snippets" because I would like to learn from your comments. Along with the library is … | |
I want get a root of number in C# what library i must to insert and what command solve it | |
When it was reported this week that [URL="http://www.itwire.com/content/view/20747/1066/"]Professor Stephen Hawking[/URL] had been taken into hospital and was "very ill" the overall mood of the media seemed to be that the Lucasian Professor of Mathematics at Cambridge University and author of the best selling 'A Brief History of Time' book was … | |
Stephen Wolfram is a British physicist perhaps best known for his work in creating the computational software Mathematica. That could all soon be forgotten if his Wolfram Alpha computational data engine proves to be the Google killer that some are suggesting. After all, it claims to be able to answer … | |
[URL="http://www.rackspace.co.uk"]Rackspace Managed Hosting[/URL] has today sent me the formula to create the perfect website, and being a nice chap I felt I had to share it with you, so here goes: [B]Pwebsite = { ((14.14* EaseNav) + (13.56*Speed) + (13.11*CleanDes) + (10.89*Func) + (10.89*Up)) – ((12.63*Pops) + (10.32*Ads) +(5.21*MultiM)) } … | |
Blink and you will see them appear in a Console window. This is a translation to C# of a Modula-2 implementation by N.Wirth, the inventor of Pascal. The tested integers are obtained by incrementing alternatively by 2 and 4, thereby avoiding multiples of 2 and 3 in the first place. … | |
A bunch of basic statistical functions. I could have made a class here and I could have used more features of C#. But just to keep it simple I left it as a console application. So the modifications you have to make if you're into C, C++, Java etc. should … | |
[TEX]Solve an equation of the form Ax^2 + Bx + C = 0.[/TEX] The class is commented, but if you have any questions don't be affraid to ask. You may exercise this class in a console application with the following snippet : [CODE]QuadraticEquation z = new QuadraticEquation(1, 3, 3); z.Solve(); … | |
Most of the time there are many ways to implement an algorithm. Here are two ways to implement the greatest common divisor algoritm, one of the oldest algorithms ever. | |
If you have to convert an angle from degrees to radians and way back, here are some utility functions in C#, along with a program to test them. I made use of the "out" keyword here, which allows a function to return more than one value. An alternative would be … | |
Hey....hello all i am writing a very simple function of calculating a square of a number entered by the user and then displaying it. While writing the function in c# i am getting n number of errors regarding conversion type....plz help me out of this .....here is the function... [code] … | |
Hi All, I'm trying to implement the NORMSDIST function of MS excel in the C#. I found its implementation from the following link. [url]http://office.microsoft.com/en-us/excel/HP052091941033.aspx[/url] and I've written the following code for this i.e. [code] static double NORMSDIST(double z_score) { double z_ = - ( (z_score * z_score) / 2 ); … |
The End.