2,827 Posted Topics
Re: [QUOTE=evilllllll;789520]Does anybody know how to fix this code? My primary roadblock is that I don't know how to make "playerMove" from my Strategy the same as the "playerMove" in my applet...[/QUOTE] Can you elaborate what you mean by "make the same"? Do you mean that they must be the same … | |
Re: It's much easier to read if you use code tags: [noparse] [code=cplusplus] //paste code here [/code] [/noparse] [code] if(p%7==0, q%7==0) [/code] I assume that comma is a mistake and you want &&, but what are you trying to do in this line? | |
Re: [QUOTE=odonal01;790579]yeah. i need the code for C++ for this to work.[/QUOTE] We realize that. You're not going to get it without some effort on your part. The post that mattwaab linked explains why. | |
Re: This link may be helpful. [url]http://www.dreamincode.net/forums/showtopic30581.htm[/url] | |
Re: Code tags please: [noparse] [code=JAVA] // paste code here [/code] [/noparse] Check your spelling: [code] System.out.[COLOR="Red"]printIn[/COLOR]("Your average hourly pay rate is $ " (+ dollars +)); [/code] | |
Re: [QUOTE=sfrider0;789625]Hey. I have to write a Fraction class for homework and overload for the Fraction class the operators +, -, *, /, +=, -=, *=, /=, and << (the insertion operator). Can somebody please tell me what exactly the insertion operator is supposed to do? I've googled it and all … | |
Re: I think it's not allocating that huge of an array because you aren't using the [ICODE]new[/ICODE] command. When I ran it, it crashed the way you had it, but when I changed it to allocate memory with the [ICODE]new[/ICODE] command, it ran. If nothing else, you can catch the bad_alloc … | |
Re: [code] double getAverage () { [COLOR="Red"] char letter [4] = {'a', 'b', 'c', 'd'}; char gradeLetter [4] = {'a', 'b', 'c', 'd'};[/COLOR] [COLOR="Red"] double average = 0.0;[/COLOR] [/code] [code] private: [COLOR="Red"] double average; string courseName [4]; char gradeLetter [4]; char letter [4]; };[/COLOR] [/code] You're going to get in trouble … | |
Re: I have a couple of code snippets that may help regarding shuffling: [url]http://www.daniweb.com/code/snippet1034.html[/url] [url]http://www.daniweb.com/code/snippet1019.html[/url] [code] for (int card = 1; card <= 52; card++) { for (int row = 0; row <= 3; row++) { for (int column = 0; column <= 12; column++ ) { if (deck[ row ][ … | |
Re: First nail down the algorithm. I can't comment on the code, really, because it's not clear to me what the algorithm to solve this is in your case. I understand the objective. I guess this is a brute-force "dumb" method (the word "dumb" here intended as descriptive rather than pejorative). … | |
Re: [QUOTE=mahdiahmadirad;787650]Hi Dears! I am a Beginner, Please Help Me. If you Can Help me to find out how to sort a 2d arrays of characters with [U]recursive bubble[/U] sort algorithm. I have got something but it doesn't work. what is my mistake? I Did codes below So far, but it … | |
Re: I have a few code snippets which may help. [url]http://www.daniweb.com/code/snippet1019.html[/url] [url]http://www.daniweb.com/code/snippet1034.html[/url] Have a look at the GenerateRandomIntegers2 function. It's easier to follow. You need to generate 20 random numbers from 0 to 99 with no repeats (if you use my method). However, your method could also work, with some fixing. … | |
Re: [QUOTE=stephen84s;785531] But instead of calling the main recursively I recommend you delegate this responsibility to some other method and let that method call itself recursively.[/QUOTE] I agree. | |
Re: [QUOTE=Freaky_Chris;784685]I still think tat you should look at the modulus symbol[/QUOTE] It's a 21 digit number. That's over 64 bits, so I can't think of a data type to put it into where you could use the modulus operator (%). I think it needs to be a string, then do … | |
Re: [QUOTE=clutchkiller;785536]sorry, i must have edited after you already posted, but i did. So i guess the real question is, well it cause problems down the road, or should it function how i would assume?[/QUOTE] I'm not sure what problems you are having. This worked fine for me. [code] #include <string> … | |
Re: [QUOTE=AdRock;778044]I'm trying to get each line of text of a file split into words and then put into an array I found an exmaple oc cpluscplus.com and their example works but when i try to edit to make changes to read the line of text from a file i get … | |
Re: [QUOTE=Aundrey;781259]Hi Guys, I'm looking for this program that i can type in about [COLOR="Red"]10 letters[/COLOR] and [COLOR="Red"]10 numbers [/COLOR]and it will generate for me all the sequences that exist in [COLOR="Red"]those numbers[/COLOR], is there such program?[/QUOTE] First, define the problem better (see red above). What are the letters for? You … | |
Re: [QUOTE=maykofs;773276]Hello! Can somebody help me? I'm reading C++ for Business Programming and there is a exercise asking for a program able to write the folowing: X XXX XXXXX XXXXXXX XXXXXXXXX XXXXXXXXXXX XXX Using nested loops someone can solve this?[/QUOTE] Yes, many people can solve this. You need to use code … | |
Re: [QUOTE=kevinchkin;781836]Dude .. how rude are you... If you don't want to give some useful suggestion then why do you even bother to reply to these posts. And if you think that asking for project idea is "lame," then I feel sorry for people like you. FYI, "lamers" working in google … | |
Re: So the output for 5 should be something like this? [code] * * * * * * * * [/code] How about for even numbers like 6? This? [code] ** * * * * * * ** [/code] Are the diamonds to be filled or hollow? | |
I've been designing a Tic-Tac-Toe game using a 3 x 3 table. Different cells will have different borders: border-right will exist for left two columns cells, border-bottom will exist for top two rows of cells. It's working the way I think it should in Internet Explorer, but not in Firefox. … | |
Re: [QUOTE=P.I.M.P;779168]3. Using User Defined Functions do the following question: my_array = { 3, 61, -5, 38, -17, 21, 92, -64, 41, -6} Find the sum of odd and even numbers in the array !!please help me to answer this question!![/QUOTE] Do you want help or do you want someone to … | |
Re: No one is going to write this program for you. You need to make an attempt, then when you get stuck, ask a specific question. ![]() | |
Re: [QUOTE=cppnewb;778519]Is there any way in a ifstream to change the font it writes in??? Thanks! Im using Microsoft Visual C++ Extended Edition 2005 on Windows XP[/QUOTE] Do you mean ofstream? ifstream doesn't write. ofstream doesn't write with a font. It will write text to a file. What text is displayed … | |
Re: [QUOTE=Phil++;778348]Hey I need to create a test plan, I am using Black Box and White Box testing, what is the difference between the two please?[/QUOTE] [url]http://letmegooglethatforyou.com/?q=%22black+box+testing%22+%22white+box+testing%22[/url] | |
Re: Both Dev C++ and Code::Blocks installed hassle free for me on Windows XP. I didn't have to tweak anything at all with paths or anything else. The installer did everything for me correctly. Your best route, in my opinion, is to uninstall both programs, download the most current versions, and … | |
Re: [QUOTE=Phil++;777769]Walls: [CODE] int wallH[100]; int wallW[100]; int wall[100]; double total_wall; for (int w=0; (w < total_walls); w++) { cout << "Enter the width of door" << w << " "; cin >> wallW[w]; cout << "Enter the height of door" << w << " "; cin >> wallH[w]; wall[w] = … | |
Re: [QUOTE=dparas;776848]Thank you for replying, thats a good approach, i will try to implement it. Do you have a code for this approach btw? Dimitris[/QUOTE] We can't give you the full code. One thing you need to decide when you use this approach is what you intend to store and how. … | |
Re: [QUOTE=ace_dman;773265]I just want to ask something about using a stack in maze Im confused about implementing stack in c++.is it possible that I can insert a multidimensional array in a stack,how?:S (can you please give me some little bit of codes in order to do that) I did already a … | |
| |
Re: [QUOTE=cppnewb;776877]Hi. I'm beginning to wonder if youre dreading my posts - they are so dumb but.... Is there a way in Microsoft Visual C++ Express Edition to compile the program and save it as a [b].exe[/B] file? Thanks![/QUOTE] Visual C++ automatically stores the executable file in the debug folder inside … | |
Hi, I'm creating a maze game. The layout is basically a big 21 x 21 square, with 441 (21 times 21) smaller squares inside of it. Each square will be a different color, representing a wall, a character, a passage, etc., so I figured I'd make a 21 x 21 … | |
Re: [QUOTE=Phil++;776127]Hi so something like: [CODE] if (line == "cout <<") { // change it to what i want it to do } [/CODE] like that? I don't get the whole vector to file thing, sorry[/QUOTE] I think I have to agree with Mosaic Funeral on this one. It's not clear … | |
I am developing a program that creates random mazes. One part of the program involves keeping track of the correct path. Each point on the path is a (row, column) coordinate. I am trying to store each coordinate as a 2 element integer array and push it back onto a … | |
Re: [QUOTE=besktrap;775597]Hi everyone. I'm currently working on a Tic Tac Toe game, and I am having a little trouble with, well, I'm not even sure what to call them. They are a variable with brackets like so below. Anyway, I have this variable: [CODE]char Line_One[3] = { ' ', ' ', … | |
Re: The second parameter is the ending index of the substring (exclusive), not the number of characters in the substring. If you want single character substrings, you can do this: [code] number1 = inputNumber.substring(0,1); number2 = inputNumber.substring(1,2); number3 = inputNumber.substring(2,3); number4 = inputNumber.substring(3,4); number5 = inputNumber.substring(4); [/code] The number of characters … | |
Re: [QUOTE=firebike0;772424]you also messed up the important part about were the error was at - again sorry for double posting but you sort of ruined what i was trying to get help with - the part i was getting errors on was if you notice in java.txt were it says like … | |
Re: [QUOTE=JamieC90;773797]Can someone explain to me what this is? I have been asked to code a tic-tac-toe board using an array which I have done, but the brief specifies using standard input, and I have no idea what that is, but I'm guessing does not include changing the values of the … | |
I have a tic tac toe program. The game board has a table with 9 cells. The cells need to be clickable, but when I click them, nothing happens. Cells are created in line 25. The [ICODE]cellClicked [/ICODE]function on line 10 is supposed to execute, but line 12 appears to … | |
Re: Double's range is higher than int's range, but it's still way less than 1000 digits, at least on my machine. [url]http://www.cplusplus.com/reference/std/limits/numeric_limits.html[/url] It's doubtful you're going to be able to do this problem with the normal data types. | |
Re: [QUOTE=linggs;772317]Is not that I dont want to learn, I'm learning something very basic. And our teacher bomb us with this assignment. I dont have any IT background. We did ask teacher for help, but she said that she don't know. And we have to find out ourselves.[/QUOTE] Your teacher didn't … | |
Re: [QUOTE=philzz;770120]Using Dev-cpp, a small program compiles but the resultant .exe file does not run. From the DOS command, it runs. When I try from the windows run command , it flashes but immediately goes away.[/QUOTE] [url]http://www.dreamincode.net/forums/showtopic30581.htm[/url] | |
Re: > start quote: public class Date { private int _day; private int _month; private int _year; boolean checkDate=true; public Date(int day,int month,int year) { if ((day>31)||(day<1)) { System.out.println("You entered a wrong day"); checkDate=false;} else if ((month>12)||(month<1)) { system.out.println("You entered a wrong month"); checkDate=false;} if (checkDate=true) { _day=day; _month=month; _year=year; } … | |
Re: Not sure how far along you are in your C++ studies, but this terminology suggests that you are confused about what happens when you pass a parameter to a function. [quote] By testing some few things, I discovered that the numbers of vector "getallen" aren't [B][COLOR="Red"]copied to[/COLOR][/B] vector "v1"..[/quote] Note … | |
Re: [QUOTE=Swemp;769605] I've translated some of the lines of my original program, because there the text that you can read on the screen is Dutch, I'm from Belgium you know.. If you test it out... You'll see that the array doesn't read in one of the txt-files..[/QUOTE] We can't test it … | |
Re: Best argument for evolution: We've seen it happen and verified it many times in other animals like flies, which have lifespans short enough and have enough offspring per generation that we can see it quickly. Human beings just don't change fast enough, but if we've seen other living beings evolve, … | |
Re: [QUOTE=scias23;768593]help here again... if i enter AaBbCc the output should be CcBbAa or cCbBaA.. but the output appears cbaCBA.. help!!! heres the code.. [ICODE] if(a[b]<a[c]) [/ICODE][/QUOTE] If that's the goal, then this line won't work for your purposes. Any lower case letter has a higher ASCII value than an upper … | |
Re: [QUOTE=protonix;768443]I having trouble understanding what the routines are doing. Can some one point me in the right direction. I have enclosed the java files. This is part of an internet challenge to better myself.[/QUOTE] You need to post the .java files, not the .class files. If it's not too long, … | |
Re: [QUOTE=firstPerson;768896]I get it, but it seems that your code gets only a line. Where as I need about a hundred of line worth of numbers. Ant clue on how to tell the compiler that if it reaches a number < 0 , then skip it go to new line?[/QUOTE] What … | |
Re: [QUOTE=JONSER114;768433]Never mind I missed it because i am not internet savvy yet and it took me forever to find a place where i could ask a simple question. Im a little depressed but i will survive i suppose; i'm just astickler of tradition and as of this year it was … |
The End.