Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Comment every line of code. Guideline: convert uppercase character to lowercase character In this exercise, we will implement a small program that makes a string

image text in transcribed

image text in transcribed

image text in transcribed

Comment every line of code.

Guideline: convert uppercase character to lowercase character In this exercise, we will implement a small program that makes a string to lowercase. Something like String.toLowerCase0 The algorithm have to iterate all the string's characters (like we did in the previous post), and if the character is upper case, then we make it lower case. Characters are numbers so we just look at their values. If a character's value is not between the character's value ' and the character's value 'Z, then it's not an upper case letter. To make a character lowercase, we think in a similar way: if the characters are numbers, then mathematical operations on them are legal. Furthermore, because the character 'a' differs from the character A' for 32 positions, we just add to the upper case character (say M') the number 32 (and we get 'm). Let's start. The following code snippet is took from the previous post. It's just "while" loop with at the end some lines of code for printing on console

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_2

Step: 3

blur-text-image_3

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

Explain Coulomb's law with an example

Answered: 1 week ago

Question

What is operating system?

Answered: 1 week ago

Question

What is Ohm's law and also tell about Snell's law?

Answered: 1 week ago