578 Topics
| |
Hey so this is my code for checking for palindromes...it compiles fine, the problem is it doesnt work. Basically I converted the four sentences into strings without spaces or other characters and added them to a new string called newstr....i used the newstr to check for a palindrome in the … | |
I've written a Rational Class that takes fractions and can add, subtract, multiply, divide etc. I'm trying to keep my fractions reduced but for some reason, some but not all of my fractions are being reduced. I've posted my code below. I commented the fractions that aren't being reduced as … | |
Hi, I've got a problem to average lines which have same name. For exemple: > Strawberries 10 15 14 20 Pineapples 14 17 2 18 Apples 4 12 24 18 Strawberries 20 12 13 24 I would like to average values by fruit name. So, for pineapples, that easy, it's … | |
I'm having a problem getting the number of integers greater than the average in my array to display. I keep getting "You have 1 number greater than the average when there are 5 that are greater. Pls help!!! This is the code I've devolped so far: #include <iostream> using namespace … | |
I need to calculate chi squared cdf from x->infinity with n=255 degrees of freedom. I cannot seem to get it to work. You can find formulae for chi squared distributions using google. Here is my non-functional approximation code: double riemannsum(double(*fnc)(double),double dx, double xmin, double xmax) { double ret=0; double x=xmin; … | |
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 … | |
Hi All Im trying to get this to work, but can only get it to work without putting the form tags in, and wont work with more than one set of the inputs. the below is the result when i use ajax to search for item names, then want to … | |
The vanity pages to look how good and active you are compared to others is back from member's #Community Contributions part underlined links. Thank you Dani, now we know again how good we are! *P.S. How many activity points worth is giving a spammer infraction? ;)* | |
I need a little bit of help with my coding below. Whenever I try to run the second application it gives me momPalindrometrue dadPalindrometrue sisterPalindromefalse racecarPalindrometrue JavaPalindromefalse A man a plan a canal PanamaPalindromefalse Hurray for HollywoodPalindromefalse Mr Owl ate my metal wormPalindromefalse Was it a car or a cat … | |
Hello, I'm trying to write a program using MIPS Assembly Language (I write the code in TextWrangler and run it in QTSpim) I was wondering how I would go about checking if a number is perfect or not. I know my first lines of code may be partially incorrect but … | |
I want to be able to write a program that repeatedly prompts the user to enter an integer. The program determines if that numbers is perfect and then writes out a message saying if it is or not, then prompts once again. I'll end the loop (and the entire program … | |
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 … | |
Hello problem i am having is when trying to multiply polynomial 1 by polynomial 2 polynomial 1 gets mutliplied by the first term in polynomial 2 and not by each term in polynomial 2. Below is my code: ~~~~ /********************************************************************************************* * Multiplies Polynomial 1 to Polynomial 2 * The method … | |
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 … | |
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 + … | |
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, … | |
So ive been trying to get an average of this array needed, and I seem to be having trouble with it. So far, my current code just adds the numbers up, but doesnt really average them out at all: [CODE]import java.util.Scanner; import java.util.Arrays; public class Grades { public static void … | |
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} … | |
I have to find factors of 1-10 then count all factors and find if they are odd/even. I know how to find if they are even or odd i just can't count how many factors for each number. #include <iostream.h> #include <stdlib.h> int main() { int num, icntA, icntB, icntC, … | |
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. … | |
Hi, I am currently newbie in C++, I just learned it for around 2 weeks, My question is when I put the number, it shows if it's a prime number or not. The only problem when I put 2 and 3, it supposed to be prime numbers, but the fact … | |
| 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 … |
I need to Compute 2x4 +7x3 -15x2 +3x+2 Using Horners Method. When I run this in QTSpim it doesn't give me any errors but I'm just wondering if everything is running completely right. For instance did I call "x" correctly? I'm trying to load the value for x from memory … | |
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 … | |
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 … | |
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 … | |
I wrote this code for an assignment that asked to create a program that calculates and displays the average of any amount of real numbers. The program is supposed to ask the user how many numbers they want to enter and then use a loop to ask the user to … | |
I wanted to write a program to check if string entered is a palidrome. I wrote a program but i get errors while compiling. Can anyone help me identify errors in the program. [CODE] #include<iostream> #include<string> int main(){ string input;bool flag=false; cout<<"Enter String: "; cin>>input; cout<<"You Entered "<<input; int length= … | |
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 … | |
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 … |
The End.