Question: Create a C++ program that utilizes loops and conditions to make sure an entire word is lowercase. You should: Get a string input from the

Create a C++ program that utilizes loops and conditions to make sure an entire word is lowercase.

You should:

  • Get a string input from the user (you can accept multiple words or not; I encourage multiple)
  • Print the input the user has given you
  • Loop through the string
    • Hint: treat it like an array
    • You're going through letter by letter
      • Think: variable[0] --> first letter of variable
  • Check if a character is uppercase
    • If it is, replace it with the lowercase version of itself
    • So, example:
      • variable[index] = lowercase letter
  • Print the altered, lowercase version of the input

HINTS:

  • variable.length() -- works on a string variable, returns the length of the string
  • isupper(item) -- send an item to this; returns boolean true or false
  • tolower(item) -- send an item to this; returns the lowercase version

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!