300 Topics

Member Avatar for
Member Avatar for hovestar

I made a program to find primes, but it can't find any prime less that 7(e.g. 2, 3, 5) any ideas? [CODE]import math from math import sqrt x = 1 y = raw_input("What number do you wish to find all the primes below? ") y = int(y) while x < …

Member Avatar for TrustyTony
0
163
Member Avatar for dv1r

i know this is a stupid question but i just don't know :\ if i have 2 time variables [CODE] a = 00:00:12 and b = 00:00:05[/CODE] how would i add them together to make [CODE] c = 00:00:17 ?[/CODE] i get the data from the database in this format …

Member Avatar for Biiim
0
199
Member Avatar for ppetree

Hey All... This query is waaaay outside my skill set so I can't even fathom how to do this other than the "brut force" method and that's way to slow for my purpose (a mobile app). I have two tables, `Categories` and `Articles`: `Categories` has: `id`, int auto-increment `name` text …

Member Avatar for smantscheff
0
208
Member Avatar for neveragn

[CODE]#include<stdio.h> #include<string.h> #define SIZE 100 int main(void) { int array[SIZE], i, n, j, sum=0; printf("Enter some integers:"); for (n=0;n<100;++n) { scanf("%d", &array[n]); if(array[n] == -1) { j=n; break; } j=100; } for(j<=100;i>j;++i){ printf("%d", array[n]); } for(j=0;j<n;++j){ sum=sum+array[n]; printf("The sum is %d\n", sum); } return (0); }[/CODE] [I]Im trying to output …

Member Avatar for neveragn
0
282
Member Avatar for my.name

Hello everyone, :) I have exercise for class that I can't complete, I don't understand why my loops aren't working The question--- Write code that will print a multiplication table for 10 positive integers across the columns and 10 positive integers down the rows. Prompt the user for the starting …

Member Avatar for my.name
0
828
Member Avatar for Otter992

the question asked me make a program that would find opens an read a txt file and calculate or display the following. - the number of numbers - sum of all the numbers in the file (running total) -average of numbers in file the .txt file just has 100,200,300,400,500,600,700 each …

Member Avatar for gevorg1808
0
210
Member Avatar for je5ter461

below is my current code for a math game i'm having problems creating the answer checking part of it, any assistance is appreciated. [code] import javax.swing.*; import java.util.Random; import java.awt.Button; import java.awt.Color; import java.awt.Dimension; import java.awt.Event; import java.awt.event.*; import javax.swing.*; public class MathPanel extends JPanel { // Declares Labels and …

Member Avatar for je5ter461
0
198
Member Avatar for maynardjk13

Greetings! I've been working on this program for the past couple of hours now, and I cant seem to get it right. I'm supposed to write a program that reads in integers from a text file, and then find the sum of the integers. The problem I'm having is with …

Member Avatar for maynardjk13
0
230
Member Avatar for TrustyTony

Here is class that can be fed directly from split stream like one number per line file (or [URL="http://www.daniweb.com/software-development/python/code/321725"]generator producing 'words'[/URL] from multiple numbers per line).

Member Avatar for Gribouillis
0
607
Member Avatar for Maxipak

Howdy! I've searched the forums and Google for ideas but all the information/advice I found was either not helpful or inaccurate. So, perhaps someone here can help point me in the right direction. I'm heading off to University next year but, before I do that, I'd like to study some …

Member Avatar for Chrishas
1
266
Member Avatar for rpv_sen

I am facing problem on sum of dynamic array value. For example : [B]tablename : totalamt[/B] ref_no | Amount 1 | 58 2 | 12 3 | 11 i am using check box to select the ref_no. now i am selecting 3 check box now and submit it. Now it …

Member Avatar for diafol
0
192
Member Avatar for HungMob

Hello again! I was given an assignment the other day in C++ and I was suppose to use the counter and add a sentinel so the program knew when to stop. Instructors directions: "The file for this assignment reads a sequence of positive integers from a file (2 3 5 …

Member Avatar for HungMob
0
188
Member Avatar for 5minutes

So I am supposed to write a class that converts fahrenheit to celsius (& vice versa), calculates the volume of a sphere after a radius is entered, and calculates the hypotenuse of a right triangle, all using nothing but static methods. Here is what I have so far; [CODE]class Fun …

Member Avatar for JeffGrigg
0
168
Member Avatar for Labdabeta

I have this problem: [CODE]struct Position { float x; float y; float z; }; bool CheckCollision(Position *vertices, int numvertices, Position start, Position end) { //return true if there was NOT a collision with the polygon defined by the vertices and the vector defined by the two positions. }[/CODE] I dont …

Member Avatar for Labdabeta
0
210
Member Avatar for oberlin1988

This is the program I need to write: At each step the user is asked if she wants another number. If she does, the program adds a random number between 1 and 10 onto her total. The game ends when she quits, or when her total is 18 or higher. …

Member Avatar for JoshuaBurleson
0
252
Member Avatar for CoolPrizes

So I need help on how to calculate how much change to give back to a customer. I need the program to give change in the least bills and coins as possible. Ex. Customer's item costs $13.37. He/She pays $20. Program gives back: One $5 Bill One $1 Bill Two …

Member Avatar for CoolPrizes
1
7K
Member Avatar for mitchiexlolz

I am currently making my project and it involves graphing functions. I have chosen Java because as I have surfed the net, i was able to download a library (JGraphT) that tells me that it can help me graph mathematical functions. Now, my problem is, i dont know how to …

Member Avatar for leiger
0
117
Member Avatar for churva_churva

[CODE]Option Explicit Private Sub cmdExit_Click() End End Sub Private Sub cmdRun_Click() Dim num(19) As Integer Dim i As Integer Dim sum As Integer grd.Rows = 2 grd.Cols = 2 grd.Clear For i = 0 To 19 Step 1 num(i) = InputBox("Enter any integer") lstno.AddItem (num(i)) Next i grd.TextMatrix(0, 0) = …

Member Avatar for BitBlt
0
425
Member Avatar for ddanbe

What polar coordinates are is explained [url=http://en.wikipedia.org/wiki/Polar_coordinate_system]here[/url]. I wanted to draw some polar functions myself, so I changed my [url=http://www.daniweb.com/software-development/csharp/code/217204]plotting class [/url] a bit and added a polar struct to a new project.. Just posted code for the Plot class and the polar point structure here. You can find an …

2
999
Member Avatar for b89smith

I have a table similar to the one below: Month | Item | Qty | Cost of Items purchased Jun | 1 | 10 | 50 May | 1 | 5 | 0 Apr | 1 | 5 | -18 Mar | 1 | 7 | 0 Feb | 1 …

Member Avatar for b89smith
0
82
Member Avatar for fashxfreak

How to calculate the sum & product of dis-similar numbers of an array[10]. i do have a code but it stop working after a certain limit, so please help.....

Member Avatar for Aslan89
0
291
Member Avatar for desert564

the following program is to print all possible sum combinations of a number for example 6=1+5,2+4,3+3,1+1+4,1+2+3 12=3+9,4+8,5+7,.......,1+1+2+3+5 but i m not getting any output...maybe there's a problem with proper ending of loops pls help[CODE]import java.io.*; public class sumpermutations { public void main()throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int input,i,j,d=0,s=0,num=0,d1=0; …

Member Avatar for NormR1
0
254
Member Avatar for vijaybrar

Hi i am just new to VB.NET and our teacher told us to experiment on for loop in a ODD SUM Program you need to add all odd numbers from Input One to Input Two like that but i can't stop it from adding continuously for example i input the …

Member Avatar for adam_k
0
235
Member Avatar for Aardwolf

How would I do this in 1 line [code] $name = $firstName + " " + $lastName; //output: 0 [/code] the problem is what I think it is, is that its trying to add like mathematics. whilst I want the '+ " " +' to become a space in between …

Member Avatar for karthik_ppts
0
129
Member Avatar for shurshot

Hi all, I'm new to this forum and I am also new to Python and coding in general. While I've gotten through basic tutorials on most general topics of Python such as series, dictionary, parameters, loops, and so forth I am still very much a newbie (as you will see …

Member Avatar for TrustyTony
0
333
Member Avatar for K0ns3rv

A little program I made to try and remeber C++, first program I've written in C++ in about a year. Tested and working under windows 7 64 bit, run via command line. If you have any improvements or ideas please leave a comment. Cheers K0ns3rv

Member Avatar for mrnutty
1
315
Member Avatar for MargateSteve

I have a query which generates a soccer standings table and although it works fine there I am trying to implement a couple of variations on it but everything I have tried has failed. I have searched and asked many times and for both problems and it seems as though …

Member Avatar for urtrivedi
1
300
Member Avatar for ddanbe

I find C# very well suited for doing math and all sorts of calculations, so here is an example. Just start a Console application and fill in the code. Have fun! The code also shows a use of delegates and some Console functions. If you don't know what the Newton-Raphson …

0
3K
Member Avatar for BOOMBOOMF

hey im new in java. i needto make GUI for my program buh im confused as to what to wirte in GUI codes and wat to write in Main codes etc. could someone plz help me? mathprogram.java main class [CODE]public class mathprogram { public static void main (String[] args){ addition …

Member Avatar for mKorbel
0
330
Member Avatar for jonsan32

I've searched a while, can't find this... I'm looking for a way to present two choices for values, then to have a result immediately appear based on those choice. IE... The first choice is an option between 1, 2, 3, 4, or 5 players... and the second choice is an …

Member Avatar for jonsan32
0
215

The End.