2,827 Posted Topics

Member Avatar for greg022549

[QUOTE=greg022549;830676]This is one of the few times that I have used this web site. I am disappointed in the fact that I am looking for some help. I submitted a post called "GETTERS". I am very new to C++ and I was wanting to learn it. I turned to the …

Member Avatar for VernonDozier
0
124
Member Avatar for Azurkan

You are trying to create a Sudoku puzzle for a player to solve, or do you already have a puzzle and you are creating a function to see whether it is "legal" (no repeats)? Checking the puzzle for no repeats is a lot easier than creating a puzzle. Your description …

Member Avatar for nucleon
0
100
Member Avatar for jimjohnson123

[QUOTE=jimjohnson123;830833]This compiled successfully but I am not able to see if it linked correctly...can someone with visual studio test this out for me and see if it came back successful or not...[/quote] You can't program without a compiler. It's a waste of time. Programming is all about trial and error …

Member Avatar for nucleon
0
151
Member Avatar for raymyster

[QUOTE=raymyster;830167]i fixed it anyway yesterday :) i really hate this about daniweb everytime i ask a question no one really helps, its like the answers i receive always" i cant help you i dont understand your question this is too long to be asked on a forum unlike 10 other …

Member Avatar for VernonDozier
0
325
Member Avatar for jimjohnson123

Look carefully at this block of code. You overwrite values without doing anything with them. [code] cout << "Enter the first five bar code digits " << endl; cin >> digit1 >> digit2 >> digit3 >> digit4 >> digit5; cout << "Enter the second five bar code digits " << …

Member Avatar for WaltP
0
1K
Member Avatar for JameB

[QUOTE=djextreme5;830056]Can this program be shortened any further? [/QUOTE] Ah, a shortest code/code obfuscation contest. They're kind of fun sometimes and they've produced some of the worst coding practices known to man. We had a professor hold one for her 1st semester programming class and the department head read her the …

Member Avatar for nucleon
0
151
Member Avatar for gaspan

[code=cplusplus] #include<iostream.h> #include<string.h> #include<conio.h> #include<math.h> char inf[][50]={"Id Number:\n","Full Name:\n","Address:\n","Birthday:\n","Civil Status:\n","Gender:\n","Education:\n","RatePerHour:\n","Date of Hire:\n"}; char *record[50][50]; int count; void AddRecord(); void ViewRecord(); void DeleteRecord(); void Payslip(); void main(){ char yn;int menu; do{ clrscr(); cout<<"ABC Company\n"; cout<<"Information System\n"; cout<<"<MENU>"; cout<<"\n[1] View Record\n[2]Add Record\n[3]Delete Record\n[4]Payslip\n->"; cin>>menu; switch (menu){ case 1: cout<<"View Records\n[Enter 0 to …

Member Avatar for tux4life
0
129
Member Avatar for kahaj

[QUOTE=Rashakil Fol;789571]The program has finished, so the window closes.[/QUOTE] [QUOTE=kahaj;789574]Rashakil, it closes on me before it ever displays the sum. [/QUOTE] How can you tell? My eyes aren't that quick. I'm guessing it displays the sum, then exits in a blink. To the OP, this thread may be of some …

Member Avatar for PRATS 1990
0
101
Member Avatar for winrawr

[QUOTE=Intrade;829805]"Yes."[/QUOTE] Ditto. Yes with quotes around the word "yes". The phrasing of this sentence is a bit loose and inaccurate. [quote] I'm unsure of how declaring **x (a pointer to a pointer of x) is the same as declaring x[][] (a two-dimensional array of x's)... The theory I have is …

Member Avatar for NicAx64
0
172
Member Avatar for JameB

I think we need more code to analyze this. If the program is less than about 250 lines, post it with line numbers: [noparse] [code=cplusplus] // paste code here [/code] [/noparse] That way there's no guesswork. The problem could be in the string-reversal, the negative handling, the absolute value handling, …

Member Avatar for JameB
0
188
Member Avatar for Moe

[QUOTE=Moe;829550]Hello! I am writing a program to overload ~ operator to reverse the given string. Here is my program. The problem message is that"Could not find a match for string::string(char). I am writing my program on linux. I can not use strrev function. [code] #include<iostream.h> #include<string.h> class String { char …

Member Avatar for Lerner
0
340
Member Avatar for emiller7

[code] #include <iostream> #include <iomanip> using namespace std; char getStuNames(char[][21], int); double getStuGrades(char[][21], double[][4], int, int); [COLOR="Red"]void displayGrade(char[][21], double[], int, int);[/COLOR] int main() { const int stu = 5; const int num = 4; char stuNames[stu][21]; [COLOR="Red"] double stuGrades[stu][4]; [/COLOR] getStuNames(stuNames, stu); getStuGrades(stuNames, stuGrades, stu, num); [COLOR="Red"] displayGrade(stuNames, stuGrades, stu, …

Member Avatar for VernonDozier
0
6K
Member Avatar for jimjohnson123

[code] void compute::Add() { compute total; cout << "Enter number 1 " << endl; cin >> num1; cout << "Enter number 2 " << endl; cin >> num2; cout << "The amount is "; cin >> total; cout << endl; return 0; } [/code] You have a void function returning …

Member Avatar for VernonDozier
0
131
Member Avatar for player183

[QUOTE=player183;828887]i'll make a quick translation too.. Equipe = team joueurs = players moyenne = average i'll recap what I need too , i'm looking for a command ( or function ) to get the min/max value of each the following : age / weight / height i'm really lost and …

Member Avatar for player183
0
112
Member Avatar for madden88chw

Thank you for using code tags! Please point out the line that is giving you the error (you can highlight it in red or just tell us what line to look for).

Member Avatar for verruckt24
1
158
Member Avatar for emiller7

Get rid of all of your [ICODE]system ("clear");[/ICODE] commands (you can put them back in again later after it all works, though lots of people recommend not using the system command at all and there are good threads explaining why). You can't debug well with them in there because you …

Member Avatar for emiller7
0
83
Member Avatar for Spanki

[QUOTE=William Hemsworth;827618]>i donno how it even works lol Did you even write the code?[/QUOTE] Ditto William Hemsworth. Did you write this? What exactly do you want us to do with this? Simply fix it and post the corrected version so you can turn it in?

Member Avatar for ddanbe
0
95
Member Avatar for av11453

[QUOTE=av11453;825795]Hi Jas, Thank you very much for the earliest reply on this post. Here not always i would have a variable format type like A010. It would be I9 or D06 or F05.10. If i always have A010 then i can use replacefirst method. Since i can substitue A10 with …

Member Avatar for verruckt24
0
152
Member Avatar for shevy24

Subscribe to O'Reilly Safari. They have all sorts of good books online. It's well worth the money and far cheaper than buying the physical books.

Member Avatar for Spanki
0
212
Member Avatar for sabian4k

You don't need [ICODE]using namespace std;[/ICODE] in the functions. You already have it at the top. It may not hurt anything, but it's unnecessary and generally is only put at the top of the program. You have an ifstream in main that you don't really use. You have ifstreams in …

Member Avatar for sabian4k
0
301
Member Avatar for trelek2

[QUOTE=trelek2;827164]Hi! The simulation looks ok, it even works fine for a head-on collision. But When I print out the balls velocities I find that the momentum wasn't conserved. Eg. balls of same mass, one ball is initially stationary, other going at 80pix/s: After collision I find that the velocity magnitudes …

Member Avatar for VernonDozier
0
173
Member Avatar for free radical

You can change your if statements to else if statements and simplify them: [code] if ((((test1 + test3)/2)*2) >= 90) cout<<name<<" has earned an A for the course."<<endl; else if ((((test2 + test3)/2)*2) >= 90) cout<<name<<" has earned an A for the course."<<endl; else if ((((test1 + test3)/2)*2) >= 80) …

Member Avatar for free radical
0
119
Member Avatar for billgone

This is C++, so make your life easier and use the string library, with its find, erase, and replace functions. Find "do" and erase it or replace it with nothing.

Member Avatar for Mazzin
0
81
Member Avatar for deadmancoder

[QUOTE=deadmancoder;826999]hi ancient dragon.. thanks:) so it is a big task after all..:-O but my stupid professors wont accept it :D you know, they want us to complete a project within a week.. here's what they say, ;) 1. You have to develop an IDE (Very simple) with drawing tools to …

Member Avatar for NicAx64
0
224
Member Avatar for Nrod520

[QUOTE=Nrod520;826571]I am using the program Eclipse, so i believe it is an applet.[/QUOTE] I'm a NetBeans guy (never used Eclipse), but I'm pretty sure Eclipse can do Applets and regular old non-Applet JFrames. Regardless, what exactly do you want to have happen? Are you trying to have a JMenuBar with …

Member Avatar for verruckt24
0
115
Member Avatar for grebnesor88

[QUOTE=grebnesor88;826509]thats the thing... i dont know where to start[/QUOTE] Start by deciding what you need to do to complete the assignment. From that list, decide what you already know how to do and what you do not. Decide the overall organization of the program. For example, what should the classes …

Member Avatar for ithelp
0
107
Member Avatar for eviocg

I get these values in the foo variable when I run the program. Is this what should be passed to the system command? [quote] psexec \\a19-00 cmd.exe 'start www.google.com' psexec \\a19-01 cmd.exe 'start www.google.com' psexec \\a19-02 cmd.exe 'start www.google.com' psexec \\a19-03 cmd.exe 'start www.google.com' psexec \\a19-04 cmd.exe 'start www.google.com' psexec …

Member Avatar for nucleon
0
134
Member Avatar for VernonDozier

I finally got around to linking a website to my posts, but it's not showing up. I typed in the website URL in the "Home Page URL" box in my Control Panel, but I'm not seeing it on my posts. Did I do something wrong?

Member Avatar for VernonDozier
0
168
Member Avatar for Dontais

Everything but a constructor needs a return type, so I assume you want this: [code] Point& Point::setPoint(double xPoint, double yPoint) [/code] since it matches this declaration in the Point class (see red): [code] class Point { public: Point(double=0.0, double=0.0); [COLOR="Red"]Point &setPoint(double xPoint, double yPoint);[/COLOR] double distance(Point & p); void print() …

Member Avatar for VernonDozier
0
221
Member Avatar for odonal01

[QUOTE=odonal01;826493]plus, you would think that since this a C++ forum, that it would be in C++??[/QUOTE] Yes, you would think so? What's your point?

Member Avatar for VernonDozier
0
152
Member Avatar for star4ker

[QUOTE=star4ker;826328]I am having trouble with this program which was solved before, but I am still having an issue with the final code. Here is the assignment prompt: Write a program that asks the user to order an ice cream treat. The user selects the type of ice cream, the type …

Member Avatar for seanhunt
0
4K
Member Avatar for homeryansta

[QUOTE=homeryansta;825788]ok, back with more questions. what is push_back? I want to say it is a function, but not certain.[/QUOTE] You need to become comfortable with checking documentation. It's a big part of programming. Find a C++ site that you like. I like [url]http://cplusplus.com[/url]. Just type in what you need into …

Member Avatar for homeryansta
0
135
Member Avatar for Takafoo

[QUOTE=Takafoo;825808]Reverse the case of all alphabetic characters in the string. That is, all upper case characters become lower case and all lower case become upper case. Hello World becomes hELLO wORLD. So I figured I need to use the toupper and tolower commands. I'm just not to sure how to …

Member Avatar for Takafoo
0
68
Member Avatar for charlie81

We don't know what you are supposed to put in either because you haven't told us anything about what the program is supposed to do, whether it compiles, what lines give errors, and what those errors are. Also, please use code tags.

Member Avatar for verruckt24
0
167
Member Avatar for wonder_laptop

[QUOTE=wonder_laptop;825639]hello there, can anybody please give me an example of how to use hashtables to implement a memory in cpp.. i surfed the net for 2 hours and couldnt find anything :S im not sure whether im submitting the right queries. thank you.[/QUOTE] Type "hash table tutorial" into Yahoo and …

Member Avatar for VernonDozier
0
75
Member Avatar for cloud21

[QUOTE=cloud21;824959]Thanks for the help guys, so I need a player base class with an AI and human derived classes which both deal with the present card (rank and suit), the next guess,next card, the output result. So if the three card guesses are correct the human player wins but if …

Member Avatar for VernonDozier
0
209
Member Avatar for cassie_sanford

Working it out on paper will give you a better idea of how to do it. Your input is the number of days, you have a variable called days, so read the input into that variable. Having a variable called input is too vague. Does the number of days change? …

Member Avatar for VernonDozier
0
2K
Member Avatar for The 1

Normally the idea on this forum is to not do things via PM since the goal is to make everything public, so you'll probably get a better response if you post the rules of the game on the thread. I imagine you'll need a function to shuffle cards though, probably …

Member Avatar for VernonDozier
0
193
Member Avatar for Takafoo

[QUOTE=Takafoo;822798] I know if I take the *number to number it will work but I've been told I have to have a pointer in the getNumber function but I don't know how else to do it.[/QUOTE] Been told by who, and why do you have to have a pointer? Is …

Member Avatar for vmanes
0
123
Member Avatar for darkagn

I like verruckt24's idea. You have an image and certain parts of that image represent different "sections" (i.e. $10 bet section, $50 bet section, etc.). You need to have a mapping from the (x,y) coordinate to the section. Depending on how those sections are mapped out, you may want to …

Member Avatar for darkagn
0
173
Member Avatar for arreyes

Aside from what you pointed out, I'm not sure what you are trying to do here in this node struct. What does children represent? Is there a children data type? Is that a constructor? Is there a function called children? [code] struct node { node* parent; [COLOR="Red"]vector<node*> children(1, NULL);[/COLOR] string …

Member Avatar for arreyes
0
89
Member Avatar for leestotch

If you are terrible at math, that'll make things more difficult. The second estimation formula doesn't ring a bell, but the first does and is here. You should probably read the whole article and the links. [url]http://en.wikipedia.org/wiki/Pi#Classical_period[/url] It's a mathematical series. It gets closer and closer to an estimate of …

Member Avatar for VernonDozier
0
122
Member Avatar for jesse_johnson2

What does this function do, what does it return, and what do the parameters represent? Have you checked whether it works? [code] bool winner(tttb my_Table, int ROW, bool isWin) [/code] You immediately assign isWin to be false, it's not passed by value, so why pass the parameter? Also, at the …

Member Avatar for jesse_johnson2
0
93
Member Avatar for Jhun Phil

[QUOTE=GrimJack;820049]I am sorry but I do not get USSC - a quick rule of thumb is whenever you use an acronym, the first reference should include an explanation.[/QUOTE] U.S. Supreme Court, I imagine.

Member Avatar for GrimJack
0
184
Member Avatar for The Dude

[QUOTE=Ancient Dragon;810299]That's crazy. "Four Yards Worth" shouldn't have an apostrophy. And there are other wrong answers too.[/QUOTE] My mom was an English teacher, so I'm going to check with her. I guessed correctly on that one, but that's assuming the author is correct. Some of the comma questions aren't clear …

Member Avatar for almostbob
0
316
Member Avatar for mimis

[QUOTE=mimis;810857]I am trying to solve an algorithmic problem. First of all the user inputs the coordinates of some nodes. I have to go to the node with the biggest x( let name it E) and then to return to the start that will always be the node (0,0)( let name …

Member Avatar for mimis
0
371
Member Avatar for EJD

Please repost using code tags and formatting/indentation: [noparse] [code=JAVA] // code goes here [/code] [/noparse]

Member Avatar for llemes4011
0
111
Member Avatar for colmcy1

Code tags please and please post the code with the array declaration so we know what the type is (is it an array of characters?). Regardless, you are overwriting everything you read in every trip through the loop. [code] while (! myfile.eof() ) { getline (myfile,truck_data2); } [/code]

Member Avatar for 10Pints
0
272
Member Avatar for xonxon

[QUOTE=xonxon;816862][code] int *p; int *q; p=new int; *p=35 q=new int; *q=62; p=q; cout<< *p << ","<< *q<< endl;[/code] wat is the value of *p n *q?why? the statement p=q refer to?[/QUOTE] I don't see a variable named n, so I assume n means "and" here. You need to put [noparse][/code][/noparse] …

Member Avatar for BevoX
0
108
Member Avatar for DemonGal711

I did this project once, but I used a 2 x 2 grid rather than a tree. 0 cat 1 bat 2 cot 3 cog 4 dog etc. I'm not sure how you would do it with a tree, but I assigned each word an index. For each pair, I …

Member Avatar for DemonGal711
0
91

The End.