578 Topics
| |
Your task is to write a main program which asks the user for an error value and then calls a function CalculatePi (error) which returns an approximate value of π. The function CalculatePi should use a loop to calculate the above series (*). It should keep two values, currentApproximation and … | |
Im new to c++ and this is our first assignment. I dont even know where to start. Help! Your task is to write a main program which asks the user for an error value and then calls a function CalculatePi (error) which returns an approximate value of π. The function … | |
Hi folks! :) I'm here with a problem of Assembly 8086 (x86) (NASM). I´m trying calculate the sum of all numbers, which are odd, lowers than X (X = number defined by user) Already solved the problem in C # and C + +, but i need the Assembly Code. … | |
I've taken 1 course in Java and 1 in C++ and now I'm tinkering with Python (love it so far). My module I'm currently working on is designed to solve a certain puzzle. To understand the code you'll need to understand the puzzle: There is an upside down triangle with … | |
Hello I have problem with adding two numbers that are less than 10 and their result is more than 10. [CODE]#include <iostream> #include <sstream> #include <string> using namespace std; typedef class node * node_pointer; class node { public: int num; node *nxt; }; string reverse (string str) { int len … | |
[CODE]int main() { static short multiplycounter; static short dividecounter; double decimal; int rdecimal; cin >> decimal; rdecimal = int(decimal); cout << setprecision(10) << decimal << endl << rdecimal << endl; if(rdecimal % 1 != 0) { while(rdecimal % 1 != 0) { if(rdecimal % 1 == 0) { break; } … | |
I'am beginner in Java, and I'am having a lot of problems while typing or making the sum of numbers. The fact is that I want to calculate the sum of pressed numbers until I press -9999, meanwhile when I press -9999, I want program me to show the sum of … | |
Hi! First of all I would like to apologize; I dont usually ask for favours but I have blocked with a Sparc exercise. [CODE]"Write a program in assembly language SPARC applying multiple string from the keyboard. The end of the sequence of strings is determined by a null string. The … | |
Team - I hope you can give me a hand here. I am working on a shopping cart type site which displays products in a datalist. I need to find a way to add up all the products and place that total in a label outside of the datalist. Also, … | |
Hello everybody! Im a new to this site. I wonder how can I get the row dimension of a matrix. For example i have a matrix double[n,m] and i want to get n provided m is unknown. So what property of method should i use??? Thank you | |
Polynomial hash code in hashing is used to convert character strings to numerical values. Use Horner’s rule to implement this algorithm, and also perform the character conversion using ASCII format. Conduct experiments to study the collision rates for this hash code by using different values (prime or non-prime numbers) for … | |
With this code you can explore the functions of math module interactively seeing the docstrings automatically for each function. EDIT: The docstring was unfortunately from old code, this version copes with values like 'e' and multiple parameter functions. | |
So my problem is that, i have a text area with 3 rows. Its a part of a chat application which receives text from a user. I want to send the text and clear the text area as soon as the user presses the enter key. Now the problem is … | |
[CODE]#ifndef Prog_h #define Prog_h class Prog { public: int Array[]; int N; void ReadList(int Array[], int N); void Avgs (int Array[], int N, int &Ave, int &aveP, int &AveN); int Large (int Array[], int N); void Display(int Array[], int N, int Ave, int AveP, int AveN, int Max); }; #endif … | |
Hello, :?: I need help with adding int arrays i got the everything working except for when i need to carry more than once and if the carry isn't in the ones digit honestly i can't think of anything :$ any ideas, suggestion, code would be welcomed [CODE] public class … | |
Hey, I'm a student, doing VB at college. I've been trying to make a program to compute Pi, and am making good progress, I think I know what to do. However, part of the algorithm requires me to cube a number. The way I'm doing it is having stored the … | |
Hi Guys, As the title says really... Sounds simple, it is. But....! I'm dealing with huge numbers here. I'm dragging bandwidth from a logging system I am developing for a client and it returns it in BYTES... Very accurate :| This is the sort of number I'm dealing with here... … | |
i have a problem with my coding to fing wether given string is palindrome or not without using strcmp(); and srtrev(); it returns "the string is not a palindrome " for all string the [CODE]#include<stdio.h> #include<string.h> void main() { int n,i,j; char a[100]; scanf("%s",a); n=strlen(a); printf("the length ia%s,%d\n",a,n); while(i<=j) { … | |
This snippet generates the best rational approximations of a floating point number, using the method of continued fractions (tested with python 2.6 and 3.1). | |
Hello! I need to write a program to find whether a word is a palindrome or not. What differentiates this from the other palindrome threads in this forum is that I can only use certain functions. They are: If statements, string functions (to upper, to lower, indoxof, length, substrings), for … | |
Alright im trying to create a program that allows the user to input numbers into an array and then will take the average of all the numbers within the array but im getting very strange results any help is much appreciated [CODE]#include <stdio.h> #include <stdlib.h> #define SIZE 9 int main(void) … | |
I know next to nothing about statistics so tried Statistics::Basic because it seemed easy to use. Then I tried Statistics::Descriptive because it has functions that Statistics::Basic lacks. What I did not expect was to get a different result when calculating Standard Deviation using Statistics::Descriptive than when using the other module … | |
Hi, I am developing some code to run on hardware and I am using the sin() and cos() functions inside the standard math.h many times, which slows the program down dramatically. I was wondering if there is a way to "approximate" the sine and cosine of a value (angle is … | |
Here another small snippet of mathematical nature returning all possible divisors of number. (set is, by the way, needed because of perfect squares Not possible to edit the snippet part but here the same with less stupid command line interface (not repeating the loop): [CODE]def divides(n): return sorted(set(sum( ([x,n/x] for … | |
We know that 0.1 + 0.1 + 0.1 - 0.3 = 0.0 But in python 0.1 + 0.1 + 0.1 - 0.3 = 5.5511151231257827e-017 Is there any way I can get 0.0...?? | |
[CODE] #ifndef POLYNOMIAL_H #define POLYNOMIAL_H class Polynomial { public: Polynomial(); Polynomial(int ,int []); ~Polynomial(); const Polynomial operator+(Polynomial& p) const;// addition const Polynomial operator- (Polynomial& p ) const; // subtraction int getExponent(); //void setExponent(); void setCoefficient(); int getCoefficient(); void printPolynomial(); private: int exponent; // exponent int coefficient[ 10 ]; // coefficients … | |
Hi All, I am working on a graphics project which involves simplification of images using triangle decimation. I am coding along the lines of [url]http://mgarland.org/software/qslim.html[/url] and [url]http://jsomers.com/vipm_demo/meshsimp.html[/url]. The problem is that for the ply file that i have and the implementation that i did, there are small triangles spewed across … | |
I want to find it out for the number 2345678901233.. but it is giving the error ..is there any method to find out the primes beyond the range of integer..[code]import java.util.*; public class inc { int flag=0; int h=2; public void checkprime(int k) { while(h<k){ if(k%h==0){ flag=1; } h++; } … | |
Hello everybody! I have to Questions to ask please: 1) How can I find the maximum value in a single linked-list recursively? this is what I tried to do: int findMax(int key){ Node max=head; while (max != null){ if (max < max.getKey()) return(max.getNext()); } } it ends up to an … | |
Here some experiments to pretty print polynomials with help of vegaseat's tip of wx.lib.fancytext. |
The End.