- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 28
- Posts with Upvotes
- 21
- Upvoting Members
- 19
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
108 Posted Topics
Re: [code] int main () { //Declare variables int choice; //Set the numeric output formatting //cout << fixed << showpoint << setprecision(2); do { //Display the menu and get the user's choice. showMenu(); cin >> choice; //Validate the menu selection. while (choice < 1 || choice > 5) { cout << … | |
Pretty neat text-based RPG that I made. Currently my first game. ![]() | |
Well we all have seen the common questions on creating squares and hollow squares out of asterisks in C++, but how about creating a program that prints out a circle in asterisks? Obviously this would look like an oval due to line adjustment, but it would be quite interesting to … | |
I accidentally posted a lower version of the game that had more flaws, and a few less features. This one has a few more minor bugs fixed, and a power attack instead of a normal attack. | |
Re: Pretty long, ALMOST twice as long as the rpg I made a little while back. Sadly it does not work in VC++, did you use Dev? (102 errors) | |
I keep getting errors and I don't know why.. #include <iostream> using namespace std; class IceCream{ private: int flavor[3]={0,0,0}, topping[3]={1,2,3}, scoops[3]={4,5,6}; public: int getFlavor(int); int getTopping(int); int getScoops(int); void setFlavor(int); void setTopping(int); void setScoops(int); }flavorX, toppingX, scoopsX; int IceCream::getFlavor(int choice){return flavor[choice];}; int main() { cout << flavorX.getFlavor(1); system("PAUSE"); } | |
Hey everyone, I am taking an online C++ class and part of our assignment is to complete a whole bunch of small program snipits on a site called myprogramminglab.com. This one program seems to have me stumped as I am not very familiar with Data structures. Could someone help me … | |
| |
Hey guys, I need a really simple code for chatting across consoles. I have looked up many tutorials on how to do this, yet they all seem to fail. All I want is a VERY simple chat that sends data from the client to a file, and then receives the … | |
Hey Everyone. I recently created a game in abode director, and lost the .dir file. I currently ONLY have the .dcr, and back when I created the game, I added an obnoxious 'permanent' banner to an old affiliate who did not support me back. (So I would prefer to no … | |
Re: Well, you can "Jump" To different sections using a simple goto statement. However, goto's mess up the format of your code, and therefore is bad practice. So I would recommend using while/do-while/for loops to go to different parts of your code. If you don't care about your format, then here … | |
Re: [QUOTE=Suzie999;1344486]I've noticed a lot of posts here with kids wanting their homework done. Is this a new thing or has it always gone on? and does anyone ever fall for it?[/QUOTE] Yes and Yes. Although people who give the codes away without any effort from the receiving end and those … | |
Re: When you run the program select, Debug > Run without debugging. This makes it so the screen will stay open. Or you could use System("Pause"); but that makes your code un-portable. Or you could use cin.getch or something like that. | |
Hello all, I need help with a scientific notation problem. I am to create a program where the user enters a 5 digit number, and it is displayed in scientific notation. This part is easy, however I am trying to take it to the next step and make it so … | |
Re: Looks fine to me. [code] #include<iostream> #include<String> using namespace std; string __stdcall myFunc(string s) { if (s == "banana") { return "Good String"; } return "Bad String"; } int main(){ string s = "banana"; cout << myFunc(s) << endl; } [/code] ***Maybe you forgot the "#include<String>" header? | |
Re: Please use code tags, and all of the "text" in the switch statement is not needed. You just need to change the amount within the switch. you also have a few unneeded headers. Also, your decimal allocation code is a bit long, and you can shorten that up to one … | |
Re: My first game I wrote was an rpg(made it yesterday), so yes..I am new as well. As a matter of fact, I've only been learning c++ this month. Anyhow, make an RPG where you choose your character and battle enemies...it isn't as complicated as you would think. | |
Have any of you just felt like expressing your feelings through text in the most efficient way possible? Well Poetry can usually satisfy that urge. So post them here, and comment on the ones you would like. I myself am not a writer or anything close to that, but I … ![]() | |
Re: ACII characters are just a bunch of random characters assembled to create one grand character. Here is an example of a 'T' in ASCII: [code] ************* ************* *** *** *** *** [/code] | |
Re: why is 'Rob' capitalized in robot? Is this in dedication to Robert Martinelli? But yeah, you need to start off with the basics first. ;D | |
Re: I looked at it, and I would suggest adding a random number between 1-4, and then adding a simple 'switch' statement to change the comment based on the random number. And as hnizamoglu said, it would be more convenient for us if you posted the code embedded into the site … | |
Re: Yes it is possible. You can use any of the following functions to do so as well: The standard, unportable [URL="http://linux.die.net/man/3/system"]system()[/URL] process, or these ones which give you a bit more control: [URL="http://www.manpagez.com/man/2/fork/"]fork()[/URL], [URL="http://linux.die.net/man/3/exec"]exec()[/URL], [URL="http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx"]CreateProcess()[/URL] | |
Hey everyone, I got bored and decided I wanted to make a 'pitch' cards game in c++, however I came across the problem of generating all 52 cards in a deck without duplicating the same card. So basically, I just want to print out every single card in the deck … ![]() | |
Re: So many errors. Your semicolons were in the wrong place, you have the incorrect definition of using greater-than/less-than symbols, you should switch to the header, <iostream> without the ".h". You also need to make the main function, "int main()", not just main. Well, there may be errors, but I got … | |
Hello everyone, I am trying to make a simple web browser for my own benefit (not a school project). I have been looking through multiple videos on how to do so, and could only find 'simple' web browsers on almost every video for visual c++. Anyway, the videos work, but … | |
Hello, I have been having a problem with the following code: [code] #include<iostream> #include<time.h> #include<iomanip> using namespace std; int main() { float average; setprecision(5); fixed; average = 100-((25/(130-(50-(130/3))))*100); cout << average << "\n\n"; } [/code] I cannot seem to get the 'average' variable to come out to exactly 79.73 like … | |
Well, I had my program running perfectly, and I was quite pleased with the results. However, after I made the text file a bit big, the program just stopped working all together. (255 lines of text) so I 'suppose' it is a bandwidth problem..however 255 lines of text is like … | |
Heh, well my daily project is near finished, and I was looking around for a way to get rid of punctuation from a character array. I looked through the web a bit, and only found immensely complicated formulas which I did not feel like dealing with. So my question is: … | |
Please tell me why this doesn't work: [code] #include<iostream> using namespace std; int main() { char felix[3] = "ho"; if(felix == "ho") cout << felix; } [/code] | |
Hey guys, sorry I am asking so many questions lately, but I am learning this stuff by myself, and find it easier to ask questions here than look online. Plus when I try using the search engine on this site, it takes me to some quite random threads. Anyhow, onto … | |
Re: Well, first off you are not asking the user for one of the designated arrays. you would need something like this: [code] for(int x=0;x<5;x++) cin >> no[x]; [/code] Next: Your loop is not going to work. It should be: [code] for(int i=4;i>=0;i--) cout<<no[i]; [/code] On another Note: Be sure to … | |
Re: To expand upon what nat had showed you, I would also like to introduce you to 'loops' and 'switch statements'. They are not hard to learn, and are essential when making a program. Using the 'goto' statement is not a good way to integrate a loop. Avoid it at all … | |
Re: [QUOTE=khaled.s;1146501]Ok, so now it's working. But i still don't know how to to continue playing if the player wants to play again. Please help! [CODE]// Written by Khaled Alakhond // March 2, 2010 // // #include <iostream> using namespace std; int main(){ for (int i = 0; i < 1000; … | |
Re: wait wait, why are you not using nested 'for' loops to make the triangles? It will make your code much shorter/efficient. If this was assigned by your teacher, I am sure that this is what he expects you to do. | |
Re: Hello, I know you did not ask for this, but I just wanted to point out that you don't actually need three 'for' loops within both of your main 'for' loops. You can actually just use two. As well, you can make it so you don't need so many different … | |
Re: [QUOTE=jameslat;1140842]right. my question is how can i make this program? i'm not new to programing, just in C++. so how could i go abt making this simple software? thanks for any help.[/QUOTE] You can make this program by becoming more adept in the C++ language. There are multiple tutorials online … | |
Re: [code] int N=0, x9=0; for(N; N <= 15; N++) double x9 = 0.0; for(int n = 0; n <= N; n++) x9 = x9 + pow(double(-1), n)*(4/(2*n +1)); cout<<x9<<endl; [/code] This gives me the answer of '3', so it works. Not entirely sure what I did, but the solution is … | |
Re: I has a solution to your problem! =D ..and here is your genuine answer: write a c program that computes the grade of a student using the formula. grade=40%major exam+30% ave of two long exams + 30%ave of 3 short quizzes.. Display the average of two long exams,average of 3 … | |
Re: Is it just me, or does this thread look astonishingly similar to this one?: [url]http://www.daniweb.com/forums/thread261832.html[/url] Please try not to double-thread, as I don't like to read the same thing twice. :( Also, I posted the formulas that you needed on the other thread. Just integrate them into your current code..but … | |
Re: Well, I honestly never did anything like this before, but I thought about it for a bit, and came up with a fairly simple formula for figuring out the change. I am not sure if this is what you are looking for, as your coding is a bit more advanced … | |
Re: To me, it seems as though your teacher is trying to show you how to use the modulus operand. Since you know that the modulus essentially figures out the 'remainder' of the number that you divide, it would be logical that [code]123 % 10 =3[/code] So now that you know … | |
Alright, this is the best text based RPG I have created, and I have refined all the bugs and such. I have gotten a few questions on whether it is beatable without dying, and it IS beatable without dying, but be aware that you most likely will die quite a … | |
Re: [QUOTE=moein_soltani;1134181]Can you say how you find this error?[/QUOTE] You find these errors by 'debugging' your code. I would recommend Visual C++, as it seems to be the easiest to use/most detailed in my personal opinion. | |
Re: [URL="http://www.daniweb.com/forums/announcement8-2.html"]Please Read Before Posting!![/URL] | |
Re: Adding the code would help. Anyway, just try putting in, system("cls") at the bottom of your code, then run it. | |
Re: If you are asking whether or not you can run C/C++ programs on a browser, the answer is no. I was also wondering the same question a while ago, but sadly there is no way for a client to run your program unless they DL it. | |
Re: [QUOTE=foxmulder;1082652] The game must be text-based [/QUOTE] [QUOTE=Dany_08;1086897]u need graphics[/QUOTE] No, I believe he wants it as text base. Why would you need graphics for this? All you need to do is have the user input the angle (1-180), and the force (1%-100%). Then make a calculation that will determine … | |
Hello, I need help with this problem I came across. What I have is this: [code] char answers[5][4] = {{'1','2','3','4'},{'10','0','3','0'},{'1','0','0','0'},{'1','2','3','4'},{'1','0','0','4'}}; [/code] However, this code does [B]not[/B] accept 2 digits..only one. This irks me, and I was wondering if there was a way to add 2 digits. [COLOR="Red"]Note: I am going … | |
Is this even possible? Or do I have to make the user download the program before they can use it. |
The End.