49,761 Topics
| |
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 … | |
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 : … | |
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 ( … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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, … | |
can some one help with how to use mouse in c++ can someone help me with how to use click option | |
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 | |
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 … | |
[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, … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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) … | |
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: … | |
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 … | |
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 … | |
Hi friends, How can I get the time stamp of a file from C++ program. Amit | |
Hello, I'm trying to make SNAKE (Game) under C++ with using #include <graphics.h> Can anyone help me. Thanks | |
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 | |
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 … | |
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 … | |
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; … |
The End.