i need help in the following project in c++?
444754
This sounds like school work, its a fairly simple program. you will probably want to use the cout and cin function which needs you to include iostream.h \n\nsimply use cout to print to screen, ask for input etc. then take the input using cin and store it to a int variable.\n\na good way to do it would be to ask the user what they wish to do, eg subtract, divide and take that operator first, a symbol or a number to show choice. then the next line asks for the numbers to be input.\n\neg:\n\n---------\n\nHello. what do you wish to do:\n1 - subtract\n2 - divide\n3 - etc etc\n\n>\n\n-------------\n\nthen use an if function or maybe a switch to check what their input was and do the artithmatic.\n\nso a very basic prgram may look like this:\nit may have errors i havant checked it.\n\n-----------------\n\n#include <iostream>\n\nint main() \n{\nint number;\n\n    cout << "Hello, input a number" << endl;\n    cin >>number;\n    return 0;\n}\n\n------\n\nEDIT; i re read the req, you might find inputting the selection to a char better, then check the char to see what symbol is stored in it, eg + / -. and maybe use a char array for the number input. simple take the char array, check for the space. split the numbers into 2 and caste then to an int. sounds complicated but it isnt to hard.\n\nsorry about spelling mistakes.
997805
==================\n#include <iostream.h>\n\nint main(void)\n{\n\n   int count; // holds the count\n   float sum, number, avg;\n\n   sum = 0.0;\n   count = 0;\n\n   cout << endl << endl   //  Make some space\n        << endl << "Enter a number.  Enter a zero (0) when you have"\n        << endl << "finished entering numbers and want to compute the"\n        << endl << "average of the inputted numbers." ;\n\n   do {\n         cout << endl << endl << "Data element #" << count + 1\n              << ": ";\n\n         cin >> number;\n\n         if (number != 0.)\n           sum = sum + number;\n           count = count + 1;\n\n      } while (number != 0.0);\n\n      averg = sum / (count-1);\n      cout << endl << "The average is: " << avg\n           << endl << endl ;\n      return 0;\n}\n\n\n==================\n\nThis program computes the average of a set of data values. Commented a bit for you to understand\n\nEnjoy
400603
Those mentioned above (Visual studio) are fine but for beginning I'd recommend something smaller and simpler... try devC++... it's free and can be found at bloodshed.net...\n\nthen (just to keep the tradition) write something like this:\n#include<stdio.h>\nmain()\n{\nprintf("Hello World&#92;n");\ngetchar();\n}\nThen hit f9 to save the file, compile it and run...
756121
#include <iostream>\n\nusing namespace std;\n\nchar *yourUsercode = "user";\nchar *yourPasscode = "pass";\n\nint main()\n{\n   string usercode;\n   string passcode;\n\n   cout << "LOGIN:&#92;n&#92;n";\n   cout << "USERCODE:&#92;n";\n   cin >> usercode;\n\n   cout << "&#92;nPASSCODE:&#92;n";\n   cin >> passcode;\n\n   if (usercode == yourUsercode){\n\n      if (passcode == yourPasscode) {\n         cout << "Access Granted&#92;n";\n      } else {\n         cout << "Invalid Passcode&#92;n";\n      }\n\n   } else {\n\n      if (passcode == yourPasscode) {\n         cout << "Invalid Usercode&#92;n";\n      } else {\n         cout << "Access Denied&#92;n";\n      }\n\n   }\n   \n   return 0;\n}
186666
#include <time.h>\n#include <stdlib.h>\n\n#include <iostream.h>\n#include <algo.h>\n\ntypedef double T;\n\nvoid test(int N)\n{\n  if(N < 1)\n  {\n    cerr << "Input value " << N << " too small." << endl;\n    return;\n  }\n\n  T* data = new T[N];\n  if(!data)\n  {\n    cerr << "Could not allocate data - " << N*sizeof(T) << " bytes." << endl;\n    return;\n  }\n  for(int i=0; i<N; ++i)\n    data[i] = rand();\n\n  time_t begin = clock();\n  sort(data, data+N);\n  time_t end = clock();\n  double time_elapsed = double(end-begin)/CLOCKS_PER_SEC;\n\n  cout << time_elapsed << endl;\n  delete[] data;\n}\n\nint main(int argc, char* argv[])\n{\n  if(argc != 2)\n    cerr << "Usage: " << argv[0] << "<array-size>" << endl;\n  else\n  {\n    for(int i=0; i<10; ++i)\n      test(atoi(argv[1]));\n  }\n  return 0;\n}
232131
#include<iostream.h>\nint main() \n{ \n   int stop=false;    \nchar pl='X';    \nchar p; //is used for checking when a game is won  \n  \nint v; //value    \nchar list[]="123456789&#92;0"; //create our array that holds all the values \n\n   do { //start our while loop        //INPUT \n       cin >> v;        //MARKING \n       if (list[v-1]!='X' and list[v-1]!='O')\n {       \n    list[v-1]=pl;       \n }        \nelse\n {  \n     cout << "That place is already taken.&#92;n";   \n      goto skip; //if its already taken skip the turn switch             \n}  \n    if (pl=='X')\n {  \n          pl='O';  \n   }\n   else\n { \n \n          pl='X';  \n      }        skip:;        //win checks   \n     for (int w=0; w<2; w++)\n{    \n        if (w==0)\n{       \n        p='X';   \n         } \n           else{ \n                p='O'; \n           }\n     for (int z=0; z<9; z=z+3)\n {\n     if (list[z]==p and list[z+1]==p and list[z+2]==p) {                 \n  stop=true; \n        goto GAME_END;    \n            } \n           }\n            for (int z=0; z<3; z++) { \n        if (list[z]==p and list[z+3]==p and list[z+6]==p) {\n                   stop=true;            \n       goto GAME_END;        \n        }  \n          }        \n    if (list[0]==p and list[4]==p and list[8]==p or list[2]==p and list[4]==p and list[6]==p)\n{     \n          goto GAME_END;   \n         }   \n     } \n       //PRINTING OF THE VALUES       \n for (int x=0; x<9; x++) {  \n           cout << list[x];   \n          if (x==2 or x==5 or x==8) {  \n              cout << "&#92;n";    \n         }    \n    }   \n     //END PRINTING OF THE VALUES \n       //system("PAUSE");   \n }\n while (stop==false); \n//End the while loop    \nGAME_END:;      \n  cout << p << " wins!&#92;n";      \n  system("PAUSE");\n}
747743
Can not give you the code or you shall not learn... so please see Page 534 of "Mastering C++" by  R Venugopal, Rajkumar & T Ravishankar  from Tata McGrawHill.\n\nI hope this will help you...
819042
is this a homework problem!? :)\n\ni haven't written C++ in a while but it seems like a fairly straight forward problem.  take a look at creating classes with static members and you'll be headed in the right direction.
27985
You can add a Perl parser into a C++ program.  Many games do something similar to this; writing the game engine in C++ and scripting the AI using Perl.
1094860
By the sound of it, either you need a tutorial or you're asking about code formatting.   Try the tutorial at the first URL below.  For formatting stuff, you can search for "C  +code formatting" and get a few hits;-)  I hope this will get you started.   I've also included a link to lots of free resources such as compilers, editors, articles and other helpful sites.  Good luck!
135843
Even me!\nBe an expert in C++ and VC++. THat will do!
646616
class publication\n{\n   private :\n      char title[20];\n      float price;\n   public :\n      void getdata()\n      {\n          cin>>title;\n          cin>>price;\n      }\n};\nclass books :: public publication\n{\n   private :\n      int pagecount;\n   public :\n      void getdata()\n      {\n          cin>>pagecount;\n      }\n\n};\nclass tape :: public publication\n{\n   private :\n      int playing_time;\n   public :\n      void getdata()\n      {\n          cin>>playing_time;\n      }\n};
120342
To really hone your abilities I recommend looking over some of the programming contest problem archives.  They are on the level of a week-long programming assignment in college and teach a variety of different skills: working from problem description to solution, basic data structures, basic algorithms, testing exterme cases...\n\nBeing able to solve problems like these will prepare you for any challenge you will come across :-)\n\nI am also including a few links to C++ resources for you.\n\nGood luck :-)
1114741
Here are some great links for C++ games and Graphics Libraries  :\nhttp://www.thefreecountry.com/sourcecode/graphics.shtml\nhttp://www.libsdl.org/index.php\nhttp://www.panelmonkey.org/category.php?id=1\nhttp://www.cppgames.com/
1174010
Buy a book. Online tutorials never helped me. I bought C++ for dummies. Its not bad.
67914
hey!! looking for ur c++ project.. source code online?? isnt a good idea!\n\nwell thetopic u've selected is idiotic.. \nu better submit an original work.. or else u'll loose marks!\n\nn if programming is ur problem.. n u're lookin for an easy way out.. try looking for tutorial sites for c++.. n search for samples .. but then be assured that ur teacher will come to know aboiut the authenticity just by the format.. \n\nwell if u're smart enough to edit the stuff n then submit it.. only then its of some use.\n\nn by the way.. i've heard of this project .. its common.. i mean even some of my batchmates did this project.. a very ordinary 1... so u may get some help from ur seniors as welll!!
983919
Here you go\nhttp://www.thefreecountry.com/compilers/cpp.shtml\n///