49,761 Topics

Member Avatar for
Member Avatar for burcin_erek

help me below algorithm. it gives wrong output e2 was wrong. 7.38..... [CODE]#include <cstdlib> #include <iostream> #include <math.h> using namespace std; int main(int argc, char *argv[]) { float x, err, term_1,result=1.0; int i=1,burcin; float factorial; cout << "x="; cin >> x; cout <<"error tolerance="; cin >> err; term_1=err+1; while (term_1 …

Member Avatar for burcin erek
0
132
Member Avatar for L.sha

I am trying to run this program, in this I have a class clocktype with its header file and implementation file. Now I am trying to inherit this class to implement a new function called timezone. The build is successful but I have 2 errors while compiling here is my …

Member Avatar for L.sha
0
186
Member Avatar for digan

i have to create a program in which a user is asked for: How many values (s)he wants to enter (maximum 50); Asks for the values and stores them into an array of double. Sorts the values in descending order. Prints the sorted array to the console. this is what …

Member Avatar for arkoenig
0
127
Member Avatar for ace8957

Hello all, So I'm working on this simple program with a Queue class template that is publicly derived from the abstract base class CharQueue. The only problem is that I keep getting hit with the error "expected class name before '{' token". The reason I don't understand this is that …

Member Avatar for Fbody
0
728
Member Avatar for sharifyboy7

Implement a class SortedList as defined by the following skeleton: [CODE] #define MAX_ITEMS 10 typedef float ItemType; class SortedList { private: int length; ItemType values[MAX_ITEMS]; int currentPos; public: SortedList( ); // default constructor: lenght=0, currentPos=-1 void MakeEmpty; // let length=0 void InsertItem(ItemType x); // insert x into the list void …

Member Avatar for Fbody
0
351
Member Avatar for Syrne

Hello! Well, I've been given a fairly difficult assignment (at least to me), and I can't seem to wrap my head around some parts. Here are the objectives: [I]"In this assignment you will demonstrate your ability to design a class and provide its declaration (.h) and implementation (.cpp) files. All …

Member Avatar for Syrne
0
181
Member Avatar for globberbob

Well, in this program I want it to take in a string or character array I really don't care which, for this instance I wouldn't know which is better. Afterwords, it compares those in if statements and sets a variable to a 1(female) or 2(male). Anyways, here is what I …

Member Avatar for globberbob
0
178
Member Avatar for boss the robo
Member Avatar for eagles39

I need to output picture of a rocket using * the program works. The top of the rocket doesn't line up with the body of the rocket. Can someone point me in the write direction on how to start it. the function i am using is called drawCone. [CODE]#include <iostream> …

Member Avatar for Taywin
0
2K
Member Avatar for raider650

[B]I included my original code down below....Basically I need some input on where to start off. From what I can tell it seems that I will need to re-organize the code into functions, while implementing the new data structure. Any input would be greatly appreciated.[/B] This time the program would …

Member Avatar for Taywin
0
97
Member Avatar for Meterior

Hey. I have this assignment in which i've to generate prime numbers up to a certain limit. Since i'm extremely new to C++ so i have absolutely no idea what's wrong with the program i have written. I have to keep it simple for my understanding. I've written it in …

Member Avatar for Meterior
0
92
Member Avatar for tauqeerahmed

hy every1... how are yuo all... plz can any one solve my problem which is followings... [B]Using stack determine whether a world is Palindrome or not...????[/B]

Member Avatar for tkud
-1
59
Member Avatar for ggyyree

About "error: assignment of data-member ‘A::pCost’ in read-only structure". Hi there, I got an error as above. My requirements are: I need a derived class A from class B. In A, there are two member functions, i.e., Initialise() and GetCost(). The Initialise() initialises pointer pCost pointing to an array, and …

Member Avatar for Fbody
0
563
Member Avatar for massivefermion

Hi all people I've written program below for a physics problem. [CODE]#include <iostream> #include <conio.h> #include <math.h> #define g 9.8342998109761958158459616185564 using namespace std; long double theta(unsigned long int n,unsigned long int N){ return (M_PI/2)-n*(M_PI/(2*N)); } long double V(unsigned long int n,unsigned long int N,unsigned long int h){ if(n!=0){ long double …

Member Avatar for SasseMan
0
338
Member Avatar for triumphost

Below has the source code to the program Im writing... anyway I want to do this... I want to be able to include a file from the project in my executable... Example: If I put the program on a different computer, I want it to able to open a file …

Member Avatar for Ancient Dragon
0
214
Member Avatar for Nemo_NIIT

HI Friends i need to convert TCHAR to Boolean value [COLOR="Green"][B]This is what i want[/B] [/COLOR] [COLOR="Red"][CODE]_TCHAR gstrEnableproxy=&quot;false&quot; o/p: boolean x=false[/CODE] [/COLOR] [B] and the code i have written is [/B] [CODE]void convertStringBoolean(String* TCHAR) { bool boolVal = false; try { boolVal = system::Convert::ToBoolean(TCHAR); } catch(System::FormatException*) { System::Console::WriteLine(&quot;The string TCHAR* …

Member Avatar for Ancient Dragon
0
292
Member Avatar for vinnieashken

I want to pass a function in an object, is it possible??, how would i prototype the class constructor to accept that, given the class pass below and the function show() so that i would create an object and pass it ie [code] pass item(show()); [/code] [code] void show() { …

Member Avatar for Ancient Dragon
0
32
Member Avatar for jjspikejones
Member Avatar for ccube921

I am getting an expected primary-expression before '=' token, how can I fix this? [CODE]void vldtmv() { if ( brd[opx][opy].cont[1]=='H' ) { if ( ( npx - opx !== 2 && -2 || npy - opy !== 1 && -1 ) && (npx-opx !== 1 && -1 || npy-opy !== …

Member Avatar for frogboy77
0
171
Member Avatar for merse

I think the following problem is a basic one in numerical codes: Suppose that we would like to do a for loop [CODE] for (double x = 0; x < Y; x += dx) { // numeric code } [/CODE] The problem is that if we set dx=0.1 it is …

Member Avatar for merse
0
370
Member Avatar for krnekhelesh

Hi, I am creating a chess program. I am creating each piece on the board. But when I try to compile the bishop piece I get this error [B][I]FATAL : Out of Memory in function set.[/I][/B] What does this mean?

Member Avatar for soltanmahmoud
0
438
Member Avatar for htataw

Hi for all, I'm newer with Delphi can anybody help me to convert the following c++ code to delphi7 one's. many thanks in advance c++ code : ********************************* #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <ctype.h> #include <string.h> #include <errno.h> #include <sys/param.h> #include <sys/types.h> #include <netinet/in.h> #include <sys/socket.h> #include <netdb.h> …

Member Avatar for pramudiyanto
0
726
Member Avatar for wmc++

Hello; I need to develop a money class that will simulate the cash box of a register. The cash box will contain coins and currency in the following denominations: $100, $50, $20, $10, $5, $1, $0.25, $0.10, $0.05, and $0.01. I am barely new in C++. I couldn't figure out …

Member Avatar for mrnutty
0
583
Member Avatar for jmcorpse

Can someone help me figure out how to either round up or down down the numbers? The numbers are used with the asterisks in the bar graph. I'm not sure if I should be using fmod or the round function. Any help would be appreciated. [CODE] #include<iostream> #include<iomanip> #include<cmath> using …

Member Avatar for jmcorpse
0
297
Member Avatar for Tecnicrow

Hello, Basically I'm trying to use operator<< to display items from a linked list. coding in the header file. [CODE] template <class DataType> struct Node { DataType info; Node<DataType> *next; }; template <class DataType> class LinkedList; template <class DataType> ostream & operator<<(ostream & output, const LinkedList<DataType> & rlist); template <class …

Member Avatar for Tecnicrow
0
592
Member Avatar for mushahidh

Hi everyone, can anyone tell me what is an alternate of graphics.h in visual studio/visualc++. Graphics.h is not working on my turbo c complier.plz tell me..

Member Avatar for jonsca
0
3K
Member Avatar for jwill222

Ok so I've got this homework problem thats killing me. Here's the problem: A bank account charges $10 per month plus the following check fees for a commercial checking account: $.10 each for fewer than 20 checks $.08 each for 20-39 checks $.06 each for 40-59 checks $.04 each for …

Member Avatar for jwill222
0
4K
Member Avatar for frogboy77

in my code i have declared [CODE]typedef signed long long int slong; const slong limit=4000000; const slong limitsqr=2000;[/CODE] i then created an array [CODE]slong* array=new slong[limit];[/CODE] without any problem. when i try this [CODE]slong* newarray=new slong[limitsqr][limitsqr];[/CODE] i get the error message: in function int main() cannot convert slong(*)[2000] to slong …

Member Avatar for frogboy77
0
122
Member Avatar for SolidSora

[CODE]#include<iostream> #include<iomanip> #include<string> class Pizza{ public: std::string type; std::string size; int toppings; Pizza(){} void setType(std::string type){ type = type; } std::string getType(){ return type; } void setSize(std::string size){ size = size; } std::string getSize(){ return size; } void outputDescription(){ //cout<<"A " cout<<getType(); cout<<" pizza; } }; int main(){ Pizza large …

Member Avatar for SolidSora
0
90
Member Avatar for Robbiedoes

Hello, I want to write a program in C++ that approaches the number pi by using the Monte Carlo algorithm. Therefore I need random numbers. When the amount of random numbers goes to infinity, the probability will approach the theoretical propability, which is a function of pi. I know all …

Member Avatar for StuXYZ
0
203

The End.