2,827 Posted Topics

Member Avatar for GrimJack

[QUOTE=GrimJack;689471]There is an interesting development in Wisconsin, Michigan, and Mississippi, state Attorneys General are suing the Boards of Election to remove all voters from the rolls whose address does not match the address in the Department of Licensing db. In some of the larger cities, plans are in place to …

Member Avatar for ZZucker
0
380
Member Avatar for Dave Sinkula

Centrist Libertarian. But it was a real stretch trying to find any of the 4 options that fit my opinion sometimes, so I'm sort of taking it with a grain of salt. You mentioned it was biased. I'd never heard of the Nolan Chart before. What do you think it's …

Member Avatar for GrimJack
0
123
Member Avatar for mathrules

You are searching for a word before you have read in any words from the file. Your call to binarySearch is on line 32. You only start to read from the file on line 36. By line 36, your "search" is complete and you have already decided that the word …

Member Avatar for sidatra79
0
196
Member Avatar for iheartcoheed129

[code] System.out.println (+text); [/code] + is a concatenation operator here. You use a + to concatenate two separate things that you want to print, so you should always have something on each side of the + sign. You only have one item to print, so lose the + sign. [code] …

Member Avatar for jared_masc
0
126
Member Avatar for dmanw100

[QUOTE=dmanw100;715752]I am writing a program using strings to pass messages into SDL functions. For some reason the compiler will not let me create any string objects though. I get a 'string' undeclared error when I try to compile this code: [CODE]#include "SDL/SDL.h" #include "SDL/SDL_ttf.h" #include <string> int errorMessage(int errorNumber) { …

Member Avatar for dmanw100
0
156
Member Avatar for Khae
Re: Mr

[QUOTE=Khae;713255]hi guys need help I resently just started c++ and on classes and have a project to print a tag to be attached on a luggage and deppending on wether the costomer want it delivered at home or pick it up at the airport. Plz find attachment[/QUOTE] I don't see …

Member Avatar for Peter_APIIT
0
100
Member Avatar for NinjaLink

[QUOTE=NinjaLink;714391]I wish I could say that worked, but it didn't. o_O I tried several different ways, but I had no luck. Can anyone help please?[/QUOTE] "It didn't work" isn't helpful. You say you've tried several different ways, but we have no idea what you've tried and we don't know the …

Member Avatar for VernonDozier
0
109
Member Avatar for NinjaLink

[QUOTE=NinjaLink;713922]I understand that I need to delete some things and make some changes, but I'm not done with the program yet. My program runs and works. I'm just trying to make this adjustment right now. I will make the further changes after I'm done. Can anyone answer my previous question …

Member Avatar for NinjaLink
0
413
Member Avatar for clutchkiller

[code] int add() { v1 + v2 == ans; } [/code] You have the same problems for all of your functions. One, this line: [code] [COLOR="Red"]int[/COLOR] add () [/code] If the word in red above is anything but [ICODE]void[/ICODE], you need to have the keyword [ICODE]return[/ICODE] in your function. In …

Member Avatar for clutchkiller
0
90
Member Avatar for chern4ever

[QUOTE=chern4ever;712993]i don get this myFile >> data1 >> data2 >> data3 >> data4; can u explain in more detail? [/QUOTE] What don't you get about it? It's the same as: [code] myFile >> data1; myFile >> data2; myFile >> data3; myFile >> data4; [/code]

Member Avatar for VernonDozier
0
233
Member Avatar for cicigirl04

He/she means that you should add cout statements at different places to help narrow down where the problem is. Figure out what the variables' values SHOULD BE at certain times, add some cout statements and make sure that what they SHOULD BE is what they are. Here is your code: …

Member Avatar for sidatra79
0
130
Member Avatar for The Dude

[QUOTE=GrimJack;709976]It is a push poll that tries to force certain answers - it pretty much sux but I agreed with Obama 71% of the time (are you surprised Dave?).[/QUOTE] Yes, and a not very well hidden one either. It has an "About the Author" page and a link to a …

Member Avatar for steven woodman
0
171
Member Avatar for IrishUpstart

[QUOTE=IrishUpstart;712867]This is what I have so far, but I am VERY certain this does not even begin to answer the question...like at all. [CODE]#include <stdio.h> #include <stdlib.h> #include <math.h> #define TOLERANCE 0.0001 int main(void) { double x, newx, delta ; int counter = 0 ; x = 0.8 ; // …

Member Avatar for VernonDozier
0
78
Member Avatar for Dontais

It's a little ambiguous what the problem is. Do you want to repeat till a -1 is entered? If so, see stilllearning's post. If the problem is that your console closes too fast to see the output and you want to keep the console open, see this thread: [url]http://www.dreamincode.net/forums/showtopic30581.htm[/url]

Member Avatar for VernonDozier
0
80
Member Avatar for VernonDozier

Okay, suppose I have a class A and subclasses B, C, D, E, F, G. I have a function: [code] public void foo (A object) [/code] I have the default function handler which handles A objects which aren't subclassed, and the B, C, and D subclasses. Subclasses of type E, …

Member Avatar for VernonDozier
0
261
Member Avatar for Dounia

[QUOTE=Dounia;63120]:rolleyes: Hi, Could you please help?? I am tired and confused. I don't what to do any more! I am trying to write a traffic simulation and i wrote some interface and some classes but the main one that has a big chunk of code seems to me like nightmare. …

Member Avatar for stultuske
0
1K
Member Avatar for minigweek

Almost assuredly your problem is that your stack keeps changing withing the move function and situations that were intended to be caught originally in one of the higher if statements are getting PAST that point and the calls are being made assuming stacks that USED to be there, but have …

Member Avatar for sidatra79
0
641
Member Avatar for mrrko

[QUOTE=mrrko;711228]Thanks a lot, without a doubt that is my error... But I tried n > i... and it give me an infinite loop... so now I dont know what to do[/QUOTE] Well what are you TRYING to do with this loop? Go through all the numbers greater than or equal …

Member Avatar for VernonDozier
0
155
Member Avatar for VernonDozier

[QUOTE=schamb;711245]also am curious as to how decimal to hexidecimal would work too just wanting to learn more about programming language and am very in experewienced[/QUOTE] You are going to have to get a lot more specific on these questions. General advice: 1. Read in a number in decimal. 2. Do …

Member Avatar for VernonDozier
0
109
Member Avatar for ae012

[QUOTE=ae012;711154]i have a machine problem to do. it should compute for the average grade of N scholars. N will be entered on the keyboard and the Student No. and Grades of the Scholars in *8 Subjects will be entered. sample output of program should be like this. STUDENT NO. S1 …

Member Avatar for emotionalone
0
260
Member Avatar for defychaos

[QUOTE=defychaos;708973]Hi :) I'm doing a programming project with development of an algorithm for a quadratic recursive sequence: (3, 3, 7, 11, 19, 20, 32), but I can't figure out which expression to use. I know it's probably got something to do with the differences of n-1 and n-2 being added …

Member Avatar for stultuske
0
91
Member Avatar for avillachandok

As previously mentioned, please use code tags. All formatting is stripped out otherwise. [noparse] [code] // paste code here [/code] [/noparse] or C++-specific code tags, with line numbers and syntax highlighting: [noparse] [code=cplusplus] // paste code here [/code] [/noparse]

Member Avatar for avillachandok
0
132
Member Avatar for gregorynoob

[QUOTE=gregorynoob;708946]hmm, well now i've implemented it, but it's so damn slow... it should work fast for 100k atleast... here's my implementation: [code=c++]#include <cstdio> #include <cstring> #include <algorithm> #define MOD 100000 using namespace std; const int coins[] = {1, 2, 5, 25}; int n, dp[100000][5]; int rec(int n, int m) { …

Member Avatar for VernonDozier
0
389
Member Avatar for alleycot

[QUOTE=ithelp;709361]Even if you do not do it as long you do not fail the course you should not worry.[/QUOTE] What a ridiculous thing to say. I certainly hope he doesn't pass the class. Not only is he too lazy to do his own work, not only does he have the …

Member Avatar for Ancient Dragon
1
266
Member Avatar for kurorokhristoff

You're on the right track: [code=cplusplus] for(int i = (value - 1); i > 0; i--) { for (int j = 0; j < i; j++) cout << "*" << flush; cout << "" << endl; } [/code] You have a loop set up to display the asterisks. Have a …

Member Avatar for Lerner
0
2K
Member Avatar for ShadowOfBlood

I think you can get rid of the outer while loop: [code] while (!isGuessed) { // code isGuessed = true; } //end while [/code] Since you assign isGuessed to true at the end, you're only going to go through the loop once, right? So it's not really a loop. Also, …

Member Avatar for Narue
0
183
Member Avatar for abelingaw

any one who can help me hello,,im a Filipino student from Cabanatuan City Philippines.. Im just a Second year College student taking up Computer Science.. I would like to ask you something about sorting an alphanumeric character.. im just a student i would like to learn in advance programming.. can …

Member Avatar for rati
0
173
Member Avatar for grisha83

[QUOTE=grisha83;708560]Hello, Here is the problem ive been working on: write a while loop that displays each int from 1 to 5 together with its square and a cube. Display all three values for integer on a separate line. My problem is that it does not really do what it is …

Member Avatar for grisha83
0
265
Member Avatar for JimHjr

Code tags and formatting are vital for problems like these. Without code tags: [noparse] [code=JAVA] // paste code here [/code] [/noparse] You'll get more help if you use code tags in the future. [code=JAVA] //Weeklypay2 import java.util.Scanner; // class Scanner public class Weeklypay2 { //main method begins execution of Java …

Member Avatar for jasimp
0
175
Member Avatar for Newguy89

[QUOTE=Newguy89;708430]the program should print 1 this one should have six spaces and then 1 22 5 spaces then 2 333 and so on 4444 sum reason when i post here it aligns left 55555 666666 though it prints... 1 22 333 4444 55555 666666 [code=cplusplus] #include <iostream> using namespace std; …

Member Avatar for Newguy89
1
109
Member Avatar for nizbit

[QUOTE=nizbit;708380]I am having a little bit of a dilemma. I have an input file that can have a number 1 through 9 or a asterisk. I am treating 1-9 as a character. I don't know if there is white space or new lines. I can't use >> because I don't …

Member Avatar for VernonDozier
0
122
Member Avatar for grisha83

You can use [URL="http://www.cplusplus.com/reference/string/string/compare.html"]compare[/URL] since you are using strings rather than C-strings. Or strcmp could work, as the last poster mentioned, though you'd have to convert from strings to C-Strings.

Member Avatar for grisha83
0
138
Member Avatar for uae_uae99

[QUOTE=uae_uae99;707685]hi everone ,actually i need ur helps. i have to submet my final project next week on 14/10 and i didnt star yet .therefore, i wanna star this week but i dont have enogh ideo 4 my topic (my topic is make program for sell and rant a car ) …

Member Avatar for VernonDozier
0
90
Member Avatar for StainlessSteelR

Code tags please. [noparse] [code] // paste code here [/code] [/noparse] Makes things much easier to read. [code] cout << "What is the number of the top floor? "; cin >> topfloor; if (topfloor<1) cout <<"Invalid number of floors. Please try again."<<endl; [/code] You say "Please try again" here, but …

Member Avatar for VernonDozier
0
191
Member Avatar for Ellisande

[QUOTE=Ellisande;706865]Haha, not even a minute before you replied I found that little section both on that website and in my textbook. Thank you for the help though. The only problem I seem to have with this is it reads the lines as a string. Is there a function in <string> …

Member Avatar for VernonDozier
0
95
Member Avatar for anbuninja

[QUOTE=anbuninja;703854]so im working on my assignment and it says Percentage of ticket revenue which goes to administrative costs. This input will be entered in percent format (see sample runs below); your program must convert this to a decimal fraction. For example, the user enters 25% as 25, not .25; you …

Member Avatar for anbuninja
0
140
Member Avatar for BINDERJ2

[QUOTE=BINDERJ2;706789][code]#include <iostream> #include <iomanip> #include <cstring> using namespace std; int main() { char name[40]; double date1; double date2; double date3; double h1; double h2; double h3; // Name of pole vaulter cout << "What is the name of the pole vaulter? "; cin.getline(name,40); // Month1, Vault1 cout << "What was …

Member Avatar for BINDERJ2
0
113
Member Avatar for jeevsmyd

[QUOTE=jeevsmyd;706316]".H" could be avoided,right? any other other changes required??[/QUOTE] [QUOTE=bhoot_jb;706473] Also, .H files certainly cannot be avoided. [/QUOTE] I think the avoidance of .h files topic stems from an earlier post from me on a different thread. Let me clarify what I meant. You had code like this before: [code] …

Member Avatar for Narue
0
172
Member Avatar for Rachmaninov

Game works great! I tested it and ended up playing it for far longer than I intended. It seems to work fine. The only thing I'd change, if you wanted to improve it, is to have some data validation, as in if users enter in illegal characters or not exactly …

Member Avatar for VernonDozier
0
6K
Member Avatar for jeevsmyd

[code=cplusplus] #include <stdlib.h> #include <iostream.h> #include<conio.h> class game { public: int num,random_integer; void dispnum(); void getnum(); void result(); void playgame() { while(3) { game::dispnum(); game::getnum(); game::result(); } }; void game::dispnum() { srand((unsigned) time(0)); random_integer = rand(); cout << random_integer<< endl; } void game::getnum() { cin>>num; } void game::result() { if …

Member Avatar for Sci@phy
0
655
Member Avatar for GrimJack

[QUOTE=GrimJack;705244]the armed forces are not trained in the concepts of law enforcement - this is not derogatory. The armed forces are trained to defend, attack, and contain; there is no real overlap nor should there be. If 2 police officers heard a bullet whiz by their heads, they would look …

Member Avatar for GrimJack
1
152
Member Avatar for paulo_war

Code tags, formatting, and ask a specific question. Your question is way too vague and there's way too much code, even with formatting and tags, to go through without some guidance. [noparse] [code=cplusplus] // paste code here [/code] [/noparse]

Member Avatar for paulo_war
0
107
Member Avatar for rodeostar04

Not using code tags is a major problem. After a while, when one starts to add up the extra hours one spends making sense of unformatted code without code tags, it can get really irritating. Most people eventually won't even look at it if code tags aren't used. Anyway, just …

Member Avatar for Salem
0
126
Member Avatar for DeadJustice

[QUOTE=DeadJustice;705270]Alright that worked. Though there was one problem. An y with . . over it was put at the end. Could you explain that? EDIT: I also was wondering if I can merge all white space into one ' ' char as far as the vector is concerned.[/QUOTE] I don't …

Member Avatar for VernonDozier
0
121
Member Avatar for MylesDBaker

1. ask the user for the master filename of all the truckers. 2. read that master filename into a string. 3. open the file with that master filename 4. set up a while loop 5. Read in a name from the master file 6. Get the filename associated with that …

Member Avatar for MylesDBaker
0
179
Member Avatar for blaze5488

[QUOTE=blaze5488;704014]What is suppose to happen is that I am suppose to take a string like "Micheal Jordan" and reverse it and return it with a comma after the last name. like "Jordan, Micheal" but that is not what i am getting can you help please. I have also included the …

Member Avatar for blaze5488
0
98
Member Avatar for JustLearning

[QUOTE=JustLearning;703825]First let me describe the program All it does is pull in some chars and stores them in a linked list of stacks. I have the code written to pull them in but when I need to print them I dont know how to go backwards without deleting the node. …

Member Avatar for VernonDozier
0
186
Member Avatar for JackDurden

[QUOTE=JackDurden;703855]Im just getting garbage in the output. It outputs the correct number of items but its not the right numbers. Im not sure why it is happening. The text file just has numbers like this: 12 34 56 34 67 23 64 23 [CODE]#include <iostream> #include <fstream> using namespace std; …

Member Avatar for JackDurden
0
87
Member Avatar for nizbit

[QUOTE=nizbit;702361]I know its a lot but I don't know really where to start troubleshooting it. The seg fault does not give me any info where the error is.[/QUOTE] Then you need to either use a debugger and put breakpoints in and see what lines are reached before the program seg …

Member Avatar for Insomniac119
0
161
Member Avatar for tones1986

I haven't tried your code yet, but is there a reason why you are using a set rather than a regular boolean array? [quote] In my case though, i have to use a set to store my data. [/quote] Is this an assignment where the object is to demonstrate that …

Member Avatar for skatamatic
0
429

The End.