Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Derive and prove an explicit formula for n k3 n for k ( / ). k=0 k

Answered: 1 week ago

Question

2. Outline the functions of nonverbal communication

Answered: 1 week ago