300 Topics

Member Avatar for
Member Avatar for grh1107

I'm trying to create a class which finds the sum of multiples for a given base I have the code written with out a class im just having trouble converting it into a class my total function isnt retrieving the data from the object maybe? /* If we list all …

Member Avatar for Banfa
0
179
Member Avatar for txhornsfan

Hello all, I am having some trouble with my assembly code...still kind of new, but here it goes... The assignment is to desing an assembly program that uses a dialog box to prompt the user for a number. These numbers will be stored in an array. There will be an …

Member Avatar for txhornsfan
0
670
Member Avatar for hwoarang69

I am trying to compute 2x-x+4x, so the answer should be 5x. but i am not sure how to get started. The "x"'s are messing me up. I am thinking of using for loop and replace x with '\0'. and than add or sub starting from left to right. but …

Member Avatar for TrustyTony
0
105
Member Avatar for modesto916

Good day, My Data Structure teacher asked me to do a list of exercises, and one of the questions consists of writing a program to solve the numbers decomposition problem, for example: If the user types the number 5: 5 4 + 1 3 + 2 3 + 1 + …

Member Avatar for MonsieurPointer
0
65
Member Avatar for jackmaverick1

I've decided to try to create a small (very) game in Javascript + HTML, using the Canvas element. So far, its gone pretty well, but recently I started on bullets. This also has gone well. I've decided to try to implement a bullet-goto-mouse type thing. I know this uses trigonometry, …

Member Avatar for jackmaverick1
0
151
Member Avatar for paintballer1518

Currently having trouble completing my code homework for my class. Help would be greatly appreciated. Write a menu-driven C++ program to manage employee data. Your program should begin by reading in a file of employee information (filename employdata.txt). Each data line contains the following information: {hire date} {employee ID} {salary} …

Member Avatar for paintballer1518
0
2K
Member Avatar for CodeMonkeyJunk

I have a school project and what is needed is to Write a program that prompts the instructor to enter the 10 grades of midterm 1 and store these numbers in an array. Next prompt for the 10 grades of midterm 2 and store these numbers in a different array. …

Member Avatar for CodeMonkeyJunk
0
182
Member Avatar for Griff0527

I am getting an error during the build stating: "Illegal call of non-static member function" and I cannot figure out 1) what does this mean, or 2) how to resolve it. For detailed clarification, I will type out what the assignment was (I say was because the assignment was due …

Member Avatar for raptr_dflo
0
369
Member Avatar for FraidaL

I'm writing this program to calculate the best fit line. It's not finished. I'm doing it step to step to make sure it runs so I don't get lots of errors and totally freak out at the end. Right now it runs fine, but something is really off with the …

Member Avatar for FraidaL
0
223
Member Avatar for FraidaL

I wrote this code for a homework problem. The question asks for the inputs to be an array representing a polynomial along with the degree of the polynomial and the value of x. Then it has to return the derivative of the polynomial. Until I ask the program to output …

Member Avatar for Lerner
0
3K
Member Avatar for dushtu.bor

Please tell me why it gives me always zero value? [CODE]<?php $total =0; $memid = $_POST['username']; $leg = $_POST['leg']; mysql_connect ("host", "usr", "paswd") or die ('Error: ' .mysql_error()); mysql_select_db ("dbname"); function getTotalLeg($memid,$leg){ $sql="select $leg from `users` where `username`='$memid' "; $res=mysql_query($sql); $row=mysql_fetch_array($res); global $total; $total = $total+mysql_num_rows($res); if($row['$leg']!=''){ getTotalLeg ($row['$leg'],'lname'); getTotalLeg …

Member Avatar for dushtu.bor
0
169
Member Avatar for KatseasSAvvas

Hi, I'm trying to find a way to solve this equation with two unknowns using Python: [QUOTE](a * b) = (x * c) + (y * d) + e [/QUOTE] Where a, b, c, d and e are all floating numbers provided by the user and x and y are …

Member Avatar for TrustyTony
0
280
Member Avatar for txhornsfan

I am having some problems with my "sum of numbers program," and cannot figure out why I am not getting the correct answers. This is my first Assembly programming class, so take it easy on me, please. The assignment is: Prompt a user for an integer n, compute the sum …

Member Avatar for txhornsfan
0
4K
Member Avatar for CY0T3R

/*PROGRAM TO PRINT SUM OF THE FOLLOWING SERIES - X + X*X/2! + X*X*X/3! + X*X*X*X/4!....n terms. I'm not getting the correct output. eg-for n=3 and x=2; compiler's ans = 4.66 correct ans = 5.3. HELP ME OUT...*/ [CODE]#include<iostream.h> #include<math.h> #include<conio.h> void main () { clrscr(); float x,sum=0; int n,fact=1,j,k; …

Member Avatar for CY0T3R
0
216
Member Avatar for ddanbe

While surfing the web I got to this site: [url]http://en.wikipedia.org/wiki/Fourier_series[/url] “Hey, I why not write something like this in C#!” The rather scary looking formulas did not withhold me to start coding (see below Fig. 1 and Fig. 2) The formula from Fig. 2 is hidden under one of the …

Member Avatar for skatamatic
0
3K
Member Avatar for Thisisnotanid

I need advice. I'm writing a calculator; I've got the basic functionality of it down, and have finally moved to having it process functions. In this regard, I find the standard library of mathematical functions provided by Python unsatisfactory. While the more commonly used functions are defined, some of the …

Member Avatar for Thisisnotanid
0
381
Member Avatar for Joniniko

Alright so basically i need to create a simple maths game in C. Involving addition subtraction and multiplication of random numbers. But i also need to add a timer to that. So lets say you are given 10 seconds to answer the question and every correct answer adds you 10 …

Member Avatar for JilMakias
0
449
Member Avatar for patk570

Hello everyone. I seem to be having trouble with the doMath() section of my code. I was wondering if you can help me out... [CODE] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Package Plans</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <SCRIPT LANGUAGE="JavaScript"> function …

0
95
Member Avatar for pwolf

How to return the sum of the last digits of the values in a list? i cant think of an efficient way. If it wasn't for being in a list i could do it, but im really lost. Can anyone advise me? im going to look for a way in …

Member Avatar for pwolf
0
4K
Member Avatar for ThaiAmL

Hello! I'm studying right now as an exchange student in Germany and taking my first programming course in Java, and in the last week, things have just started to go over my head and I'm kind of drowning while trying to get all the homework done! The assignment was supposed …

Member Avatar for ThaiAmL
0
996
Member Avatar for patk570

Trying to figure out why this SIMPLE math function will not work. If anyone can help me that would be great....Thanks [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Calc Price</title> <SCRIPT LANGUAGE="JavaScript"> function doMath() { var one = eval(document.theForm.elements[0].value) var …

Member Avatar for Airshow
0
214
Member Avatar for borgyborg

Hi All, I want to auto-calculate all the array textboxes I created. My code is: [CODE] <?php echo "<table>"; $sql="SELECT default_salary FROM records WHERE is_active = 'Yes'"; while ($row=mysql_fetch_array($result)) { $default_salary = $row["default_salary"]; $num_rows = mysql_num_rows($result); echo "<tr>"; echo "<td>"; echo $count."</td>"; echo "<td width=\"\" align=\"left\" border=\"0\">"; echo "<input type=\"text\" …

Member Avatar for diafol
0
853
Member Avatar for ddanbe

When you want to draw something on a form you need a Graphics object. But a Graphics constructor isn’t public and if that is not enough the Graphics class is also sealed! This means you can’t create a Graphics object via the new keyword nor can you derive from the …

Member Avatar for skatamatic
0
4K
Member Avatar for Octipus

All right. So i have child, parent, activity and register table and i want know how much money a parent will pay for his child if the child have 1 or more activities. So i came out with this code: [CODE]SELECT CONCAT_WS (' ', parent_title, parent_fname, parent_sname) AS 'Parent/Carer Name', …

Member Avatar for Octipus
0
212
Member Avatar for Chuckleluck

Hello, I'm using SFML to make a game, and, as it has no built-in collision detection function, I made up my own algorithm. Here it is: [CODE] // Collision.cpp #include "Collision.h" Side CollisionBoxTest(sf::Sprite Hitter, sf::Sprite Hittee) { sf::Rect<int> HitterBox; sf::Rect<int> HitteeBox; // Initialize parameters for Hitterbox int BoxHeight = Hitter.GetHeight(); …

Member Avatar for Eagletalon
0
211
Member Avatar for the_kitoper

I have a problem, whenever I attempt to use the following expression it returns -3. Can you please explain why this is? [CODE] int level = ((RoD * 10) - 50) / 15; std::cout << "Level = " << level << std::endl; [/CODE]

Member Avatar for LRRR
0
169
Member Avatar for hovestar

I'm trying to devise a program that attempts to solve the Collatz Conjecture, Wikipedia, but when I run it I get this error: [CODE] What value would you like to find if the collatz works for below?6 Traceback (most recent call last): File "/private/var/folders/fL/fL1lGxccGCypPBSIUXNGZGpkwIg/-Tmp-/Cleanup At Startup/Playground-345866896.786.py", line 27, in <module> …

Member Avatar for TrustyTony
0
246
Member Avatar for CodeAdmiral

For a school project, I am trying to make a program that gets user input and finds the factorial of the input. I wrote this bit of code and got tons of errors. Help, anybody? [CODE]import javax.swing.*; import java.awt.*; import java.io.*; import java.util.*; class TestFactorial { public int x = …

Member Avatar for thines01
0
250
Member Avatar for minghags

i need to sum anything that is input in input form numbers. And this has to be in order like 5,4,3 and then it has to sum like 5+4+3 = 12. Can anyone help? I came as far as the code shows above. this is the example of how it …

Member Avatar for minghags
0
375
Member Avatar for arick1234

I have an array [x,y] where the values of x is ascending and the y values are random. I would like to sum all of the y values together when the x values are within a certain range. I can't show you any code as i dont even know where …

Member Avatar for Gribouillis
0
2K

The End.