49,761 Topics

Member Avatar for
Member Avatar for Asif_NSU

i have this assignment to compute the factorial of an integer of any length. I have done it using array of char and then overloading the * operator accordingly. It works fine but i wanted to know if there were other efficient algorithms for counting factorials of any length. Give …

Member Avatar for roxanne_gem07
0
276
Member Avatar for jrice528

I am so close to finsihing my homework im on last programmign assignment. I have the program written but i cant figure out what to take from main and put into my flip function. the teacher said it should only contain one lineof code. Anbody have any ideas?Which is : …

Member Avatar for ndeniche
0
104
Member Avatar for Duki

Hey guys, Could you tell me what is wrong with this part of my code: [code]#include <iostream> using namespace std ; class TwoD { public: TwoD ( ) ; TwoD ( int , int ) ; private: int *m ; int d1 ; int d2 ; }; int main ( …

Member Avatar for ndeniche
0
83
Member Avatar for toncoolx

Hello there, I recently need to use c++ to do a project, and I occur some problems, hoping can get some advices from here, many thanks! My project allow a user to input a number and i need to retrieve the data from a text file. My text file's data …

Member Avatar for toncoolx
0
101
Member Avatar for EOTF

Hi folks, I'm having problems with my loops, and possibly more...hehe! I'm loading a text file, which has 1 word per line, into a buffer and I want to search the buffer for all the words that start with the same prefix (3 letters) and return the words in an …

Member Avatar for Ancient Dragon
0
97
Member Avatar for DemonSpeeding

I have a question about adding say integers to an array-based list of numbers. I know how to add something at the end it would be something like: values[count] = newValue; count ++; What about if someone wanted to add something to the beginning or somewhere between? My book doesn't …

Member Avatar for Ancient Dragon
0
100
Member Avatar for jacksonwee

im new to C++ and i got an assignment which required me to do a hangman game. Global variables are not allowed. program must be modular, i.e create suitable functions. for functions, i was told to use reference parameters instead of pointer parameters. i am to use string class and …

Member Avatar for WaltP
0
86
Member Avatar for Underdog67

Here's my code: [CODE=language]include <iostream> #include <iomanip> #include <fstream> using namespace std; int main(){ int ID; double largest; double secondLargest; double sales; int largestCount = 0; int secondLargestCount = 0; ifstream infile ("sales3.txt"); if (!infile){ cout << "Error: cannot find input data!\n"; return 1; } cout << " Acme Sales …

Member Avatar for vijayan121
0
79
Member Avatar for sylvaticus

Hello.. is it possible to append some data on a text output file appending the data to each row, and without use too much computational I/O ?? Instead of the classical way: [code] VARX VARY VARZ... year1 x1 y1 z1 year2 x2 y2 z2 [/code] .. I would like to …

Member Avatar for Narue
0
107
Member Avatar for dukedoc

I have this program for computing an individual's cable bill, then summing each column of values and calculating the average of each column. I got a 100 on the assignment, the program works fine, but this time we have to use functions. I created my functions and the program, again, …

Member Avatar for WaltP
0
344
Member Avatar for k7_keshav

can some one help with how to use mouse in c++ can someone help me with how to use click option

Member Avatar for GreenDay2001
0
93
Member Avatar for tnvkrishna

hello, i wrote a header file the file got deleted while i was compiling it that header file includes a class definition and nothing else what might be the problem? tnvkrishna

Member Avatar for Salem
0
94
Member Avatar for sarahger9

Hi, I wrote a program that reads a file, by building up text one character at a time, looks for keywords, and replaces them if they are found. I am working on building up my output. The words come out right, and I added the punctuation back in ok. The …

Member Avatar for sarahger9
0
88
Member Avatar for koolboy

[code] #include <iostream> #include <string> using namespace std; float input_div(string); void findHighest(float, float, float, float); int main() { float nE, sE, nW, sW; nE = input_div( "North East" ); sE = input_div( "South East" ); nW = input_div( "North West" ); sW = input_div( "South West" ); findHighest(nE, sE, nW, …

Member Avatar for parthiban
0
99
Member Avatar for zandiago

[CODE] #include <iomanip> #include <cmath> #include <fstream> #include <string> #include<string> #include<iostream> #include<iomanip> using namespace std; int main() { ifstream infile; ofstream outfile; int num;//number of grades int Hi;//highest test grade int Low;//lowest test grade sting stat;//status of grade, whether higher or lower than avverage infile.open ("grades.txt"); outfile.open ("gradeOutput"); double number;//the …

Member Avatar for zandiago
0
543
Member Avatar for cowboys111

Im writing a program to calulate the distance between two points unsing structures and functions. I have everthing working perfectly except that I cant get it to repeat for a second set of points. My input file has 10 points in it bit it stops after it reads the first …

Member Avatar for cowboys111
0
106
Member Avatar for Meglor

If i type a simply code with an output of "hello world" on the screen, printf ... u know the code, the programm isn`t able to do the .exe programm. I don`t know why. GRrrr. If i try to write difficult programms, it is the same probleme with the exe …

Member Avatar for Ancient Dragon
0
91
Member Avatar for mirakl

hi, I am finishing up a program and in the program I need to add numbers after a certain number example for every ten numbers 30, 40, 50 i need to add .125 i have this so far if ( age > 30 % 10 == 0 ) // Formula …

0
50
Member Avatar for rogenie

This is a very simple app I am trying to do. How else would sum up the total of the number the user entered? Example if the user enters 10, the loop will find the sum of 1,2,3,4,5.....10. Here is my code and I spent few hours on to come …

Member Avatar for rogenie
0
110
Member Avatar for notathing

1) Class creation Create a class called Song. It will contain the following private attributes: The song title. The artist who performs the song The duration of the song in terms of seconds. A song that lasts 3 minutes and 30 seconds will hold a value of 210. Create a …

Member Avatar for twomers
0
85
Member Avatar for sean25hun

Can anyone help me with pascals triangle . I got it to do a factorial number , now it want to display the results in a pyramid. #include <iostream> using std::cout ; #include <iomanip> using std::setw ; long int factorial(const int); int main() { long int k = factorial (5) …

Member Avatar for Narue
0
188
Member Avatar for DemonFox

i have started my midterm exersize than is on binary treescan anyone help me on the basics i have started and i have made the following on my tree.h file: [code] struct treenode { int data; struct treenode *left; struct treenode *right; };typedef struct treenode *PTR; class tree { private: …

Member Avatar for eskelsen
0
112
Member Avatar for zandiago

Write a c++ program that will read in an unknown number of employee records from a text file call “PAYDATA3.TXT”. Each employees record is a string of 47 characters (with spaces), set up as follows: Positions Data Description 0 – 14 Last Name (15 characters) 15 -24 First name (10 …

Member Avatar for zandiago
0
160
Member Avatar for Ratte

I have a template singly linked list function that has a node class: [code] template <class T> class Node { T Data; Node <T> *Next; public: Node(); Node (const T&); T getData() const; Node <T>* getNext() const; void setData(T); void setNext(Node<T>*); }; [/code] and SLL: [code] class SinglyLinkedList { Node …

Member Avatar for twomers
0
103
Member Avatar for amt_muk
Member Avatar for vijayan121
0
2K
Member Avatar for daniweb2013

Hello, I'm trying to make SNAKE (Game) under C++ with using #include <graphics.h> Can anyone help me. Thanks

Member Avatar for PirateTUX
0
338
Member Avatar for raja.geek

hi all, i would like to know the all possible command line options of GGCOV tool in Linux... ex:1. ggcov program name 2.ggcov -o dir if anyone of you know this,plz give me the details... Thanks in advance..... RajasekharReddy.B

Member Avatar for Salem
0
59
Member Avatar for Koldsoul

I am writing this program to use user defined functions, must be return value functions as well. It is a modification to a program already written, and am having a couple errors that I just cannot figure out. Here is the code, the errors I am getting when I compile …

Member Avatar for Ancient Dragon
0
94
Member Avatar for eranga262154

Hi all, I want to read a stream of bites/bytes as a String. Here's what I have done up to now. Using a buffer I found that number of bytes, which include a text message from a binary file. Now what I want is to read those bytes stream as …

Member Avatar for Ancient Dragon
0
235
Member Avatar for andrax

I know this is probably an unbelievably simple error somewhere, but I can't see it. I keep getting "undefined reference to Machine::Machine()" and all of Machine's other functions. main.cpp [code] #include "machine.h" using namespace std; int main(int argc, char** argv) { Machine* m = new Machine(); m->reset(); m->run(); delete m; …

Member Avatar for Salem
0
102

The End.