Can anyone help me answer this programming question?
-
I have yet another question I need help with. To check whether a char variable ch is an uppercase letter, you write ________. (ch >= 'A' || ch <= 'Z') (ch >= 'A' && ch <= 'Z') ('A' <= ch <= 'Z') (ch >= 'A' && ch >= 'Z')
-
Answer:
Behind the scenes, each character has a numerical value. Here is a link to a table: http://www.asciitable.com/. In this case, ch has to be greater than or equal to 65 (A) and less than or equal to 90 (Z). So: (ch >= 'A' && ch <= 'Z') is the correct answer. It can't be the first option since C++ has short-circuit evaluation for boolean statements, and a lower case letter could be accepted.
_prototyp at Yahoo! Answers Visit the source
Other answers
Behind the scenes, each character has a numerical value. Here is a link to a table: http://www.asciitable.com/. In this case, ch has to be greater than or equal to 65 (A) and less than or equal to 90 (Z). So: (ch >= 'A' && ch <= 'Z') is the correct answer. It can't be the first option since C++ has short-circuit evaluation for boolean statements, and a lower case letter could be accepted.
Caramel
It's B, but you need to do your own homework. It basically means the character value is greater than or equal to A and it's less than or equal to Z. So it has to be between A-Z (uppercase)
Scott
If you are checking for capitalization, I would define all of the uppercase alphabet and make if statements.
Shawn
It's B, but you need to do your own homework. It basically means the character value is greater than or equal to A and it's less than or equal to Z. So it has to be between A-Z (uppercase)
If you are checking for capitalization, I would define all of the uppercase alphabet and make if statements.
Shawn
Related Q & A:
- Can anyone help me do a website?Best solution by Yahoo! Answers
- Can anyone help me get directions to Commonwelath park in beaverton oregon?Best solution by Yahoo! Answers
- Can anyone help me fix my MSN Keyboard Trouble?Best solution by Yahoo! Answers
- Can anyone help me with Windows Automatic Updates?Best solution by Yahoo! Answers
- Can anyone help with the Myspace graphic?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.