49,761 Topics
| |
there're input1.txt command1.txt given files subject asking for create a result1.txt file with the data from the given files. there's no any bug while compile, but when running the program windows system pop out error report that: ***.exe has encountered a problem and needs to close. We are sorry for … | |
Could you guys please help me to solve this pathOk function, the code is: [code=cplusplus] // graph.h #include <iostream> #include <vector> #include <queue> template <typename ItemType> class Graph { public: Graph(){ }; ~Graph() { Clear(); } void AddVertex(const ItemType& theItem); void AddEdge(int n, int m); bool Empty() const; bool EdgeExists(int … | |
I have a confusion : Is there any specific advantage of using int main() over void main() in c++ programs. Can anybody solve it ? | |
I'm new in this site ^__^ and I really love it ^.* ammmmm ... I have some problem with my assignment ... could any one help me ?? ( sorry but me english weak a little bet).. | |
I'm trying to construct a semi simple dice rolling project. I have two classes, onedie and threedice. The threedice class looks like this: [code] class threedice { public: void rollem(); int getsumFaces(); private: onedie die1; onedie die2; onedie die3; }; [/code] Now, when I try to code the two functions … | |
I'm trying to figure out how to write an int (as a record number) and a string (up to 12 characters) into a binary file. So in one project the binary file is created with all 5 records written to it, with blank data, eg string is empty. In the … | |
After I Prompt the user to get an integer from the keyboard, display the number on screen if it is an even number how do I write the number into a file in A:\ drive under the name OddFile.txt. if its odd. [CODE=cplusplus] #include <iostream> #include <fstream> #include <cstdlib> using … | |
Hi, I am trying to do my project but I am stuck. It looks like a big project but it is not. here is the question : I am given sample output of rectangles and some code. I need to add few free functions to make the outout like that … | |
Heres my code: [code]#include <cstdlib> #include <iostream> using namespace std; //Function prototypes char GetTaxCode(void); int GetProductId(void); int GetQuantity(void); float GetProductPrice(void); char InvoiceInitilization(void); int main(int argc, char *argv[]) { //Variable declarations float gSt = .01; float pSt = .02; int productId; int quantity; char taxCode; float taxAmt; float productPrice; int shippingFee … | |
I've tried use a program which is will work in sqrt(n),but it got TLE.,please help me [url]http://acm.pku.edu.cn/JudgeOnline/problem?id=1811[/url] | |
I just finished an exam that I bombed pretty hard. I just dont know where to begin on this stuff and would love some guidance. Below is the details of the exam. - Write a program that asks a user to enter their full name. Their name including spaces must … | |
I'm seeming to have some difficulties with a few things. I don't quite know how to get my program to add interest and charges to the balance, and I keep getting the message in Borland C++ Builder 6, "Unresolved external 'Interest(int)' referenced from C:\Documents and Settings......etc etc." and I'm also … | |
Alright! I have to make a program that computes the n'th Fibonacci number, and then use it in a program to list the first 20 fibonacci numbers, the recursive definition of fibonacci numbers is: fibonacci(1) = 1 fibonacci(2) = 1 fibonacci(3) = Fibonacci(n-1)+Fibonacci(n-2), for n>2 then modify your program and … | |
hello all, so can any one help me with a code in c or c++ for radix sorting code for names.... i need this for an important project for my study....if any one can help by friday 21-march | |
Hi guys, I'm working on a program that has to do with Goldbach's second conjecture (any even number larger than 5 can be expressed as the sum of three prime numbers). I have to write a program that takes integer [I]n[/I] (larger than or equal to 6) and finds three … | |
Is it possible to know what key on the keyboard that was pressed through any of these syntax in any way. [I]textBox->KeyPress textBox->KeyUp textBox->KeyDown[/I] I like to find an if statement that says something like this, though I know this is wrong: [code] if ( textBox-> KeyPress != BackSpace) { … | |
Recently I've been trying to write a bit of code that will take a string, for example "This is a string", and returns the string with the contents in reverse order, such as "gnirts a si sihT". I'll only post the function that will do this. Currently, my idea is … | |
i have a formula, it is basically the result of two other previous calculations and it gives me an eror message saying that i cant use it as a function [CODE] ERRORC = (( target1 ) - ( OUTC ) )(OUTC)(1 - OUTC); [/CODE] target one is selected at the … | |
Thanks for your help earlier with the file input everyone...I have another question to ask of you. I am trying to check two vectors against each other to see if the "timeanddate" match up. Then try to output the ones that do match. I am getting errors from the if … | |
Say i ask a user to input a number, which will be the return value of one of my class members. How do i make it so that it would redirect me another class member, depending on the number input? | |
This program is using setw() and setfill() it supposed to output the stars I have included the sample output at the end of my project I hope u gona be able to read the code cause my coding does not print the stars the way they have to be instead … | |
firstly id like to thank people for helping me with my earlier problems. anyway, for this program im working on, i want the user to be able to select between two patterns. eg. pattern1 makes x=1 and y=0 pattern2 makes x=0 and y=0 i tried using if statements, but it … | |
Do you see anything wrong with this if so let me know [code=cplusplus] #include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main () { int num; ifstream AFile; AFile.open('a:\\OddFile.txt'); AFile << "Enter an integer number please: "; cin >> num; If (num % 2 = 0) AFile << … | |
Anyhelp with the ostringstream and datastream line would be appreciated. Can't seem to get the data to actually write to the text file...No data in results.txt, but the file is created by the program when I run it... [CODE] ofstream DataFile3("results.txt"); cout<<"Writing...Please wait...."<<endl; for (a=0; a<Search.size(); a++) { cout<<Search[a].date<<" "<<Search[a].time<<" … | |
I have a wondering. I have put this code in the richTextBox1 event handler. What happens is when you have written 11 characters, the 10 previous characters turns blue. What I wonder is that this code selects and deselects these characters wich can result of "blinking" in the textbox sometimes … | |
this isnt working, i think it has something to do with the natural exponential, its a calculation of the sigmoid function. it basically should read 1/(1 + e^-((W1A*pix1)+(W2A*pix2))) this is what ive coded [CODE] OUTA = 1/(1 + exp -((W1A * pix1) + (W2A * pix2))); [/CODE] please help me. | |
For the code posted below, a hangman game, how would I make it so after the conditions in the loop are evaluated, it goes back and asks for another letter input without an infinite loop? [code=c++] // Kevin Richard // Hangman.cpp // Basic Hangman console game /* Changelog: -added char … | |
Need a recommendation on how to proceed with this task...I am starting new in C++ (after taking it in high school 11 years ago it has been forgotten and has changed alot). I have put the code I have below and some sample lines of data...any recommendations on how to … | |
Hello guys, I just join your site to get help about my coding programme class c++. I do have to modify my programme that the out put will show the form sum=1+3+5+7=16. Can you please help me out thxx . Programme is adding odd integer : [code=cplusplus] # include <iostream> … | |
I have an upcoming assignment, in which I have already completed. But I was just curious if anyone could look it over and give me some input on it. I am pretty confident that I have done it correctly. But I think I have became particularly attached to this assignment … |
The End.