Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   Strings programming help (http://www.go4expert.com/forums/strings-programming-help-t28204/)

tzfrantic 16Apr2012 23:08

Strings programming help
 
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.

xpi0t0s 18Apr2012 03:34

Re: Strings programming help
 
How far have you got and where are you stuck? Do you understand the project requirements?

tzfrantic 20Apr2012 00:15

Re: Strings programming help
 
i got this far the requirements are on the first post and i am stuck on were to go from here
Code:

#include <iostream.h> #include <string.h>  int main(void) {    string s;    getline(cin, s);    cout << s << endl;    return 0; }

xpi0t0s 20Apr2012 11:01

Re: Strings programming help
 
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.


All times are GMT +5.5. The time now is 21:56.