1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Strings programming help

Discussion in 'C++' started by tzfrantic, Apr 16, 2012.

  1. tzfrantic

    tzfrantic New Member

    i am doing my code in borland 5.02

    i am trying to write a program that allows the user enter in two strings when prompted

    the program performs certain manipulation with the second string and then adds the result to the first string.

    the program should give me the user the choice of searching a string for a particular character,
    reversing the string ,changing the case of the string and reversing and changing the case of the string the output of the above string manipulation must be preceded by the first string.

    the program should be written using modular programing techniques such as functions using parameters where possible to reduce the use of global variables.

    the user should be allowed to repeat any of the string manipulations more than once in the same run of the program and be allowed to change the input strings to be manipulated during a run of the program.

    i have written out a code but it is completely wrong and i am trying to get better at c++ any help with this program.
  2. xpi0t0s

    xpi0t0s Mentor

    How far have you got and where are you stuck? Do you understand the project requirements?
  3. tzfrantic

    tzfrantic New Member

    i got this far the requirements are on the first post and i am stuck on were to go from here
    #include <iostream.h> #include <string.h>  int main(void) {     string s;     getline(cin, s);     cout << s << endl;     return 0; }
  4. xpi0t0s

    xpi0t0s Mentor

    Good start. Double that and you've got the first part.

    After that you need to display a menu of choices: reverse string, change case and so on, get the user's choice, then a switch/case to perform the operation. The menu display and switch will need to be in a loop so that the actions can be repeated as requested, and one of the menu choices will need to be to exit the program.

Share This Page