Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. //
  2. //Programmer: Dinalyn Degano
  3. //Completed:
  4. //Status: Complete
  5. #include <iostream> // input/output declaration.
  6. #include <string> // needed to use setprecision
  7. #include <cctype>
  8. #include <cstring>
  9.  
  10. using namespace std;
  11.  
  12. void upperFormat(char *stringInput);
  13.  
  14. int main()
  15. {
  16. //max string length
  17. const int MAX_LENGTH = 51;
  18. char stringInput[MAX_LENGTH];
  19. //string stringOutput;
  20. string upperFormat;
  21.  
  22. cout << "Enter a string (up to" << MAX_LENGTH - 1 << " characters): ";
  23. cin.getline(stringInput, MAX_LENGTH);
  24.  
  25. cout << "You entered" << stringInput;
  26. upperFormat(stringInput);
  27. return 0;
  28. }
  29.  
  30. void upperFormat(char *stringInput)
  31. {
  32. //char upCharacter;
  33. //char currentCharacter;
  34. //string upperFormat = stringInput;
  35.  
  36. int count = 0;
  37. while (*stringInput != '\0') {
  38. if (!isupper(*stringInput)) {
  39. cout << *stringInput;
  40. }
  41. }
  42.  
  43. //for(int i = 0; i < stringInput.length(); i++)
  44. //{
  45.  
  46. // char currentCharacter = stringInput.at(i);
  47. //}
  48.  
  49. // if (islower(currentCharacter))
  50. // {
  51.  
  52. // char upCharacter = toupper(currentCharacter);
  53. // string upperCaseString(0, upCharacter);
  54. // upperFormat.replace(i + stringInput, 0, upperCaseString);
  55. // }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement