49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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> … | |
[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 … | |
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 … | |
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] | |
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 … | |
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 … | |
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 … | |
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="false" 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("The string TCHAR* … | |
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() { … | |
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 !== … | |
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 … | |
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? | |
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> … | |
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 … | |
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 … | |
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 … | |
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.. | |
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 … | |
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 … | |
[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 … | |
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 … |
The End.