Question

C++ How do I use ASC II in order to see if an alphabet is lowercase...

C++

How do I use ASC II in order to see if an alphabet is lowercase or uppercase?

Please show me how to do this.

Homework Answers

Answer #1
#include <iostream>

using namespace std;

int main() {
    char ch;
    cout << "Enter a single character: ";
    cin >> ch;

    if (ch >= 'a' && ch <= 'z') {   // we can simply compare with 'a' and 'z' see if character is in the range of lowercase
        cout << ch << " is lowercase" << endl;
    } else if (ch >= 'A' && ch <= 'Z') {   // we can simply compare with 'A' and 'Z' see if character is in the range of uppercase
        cout << ch << " is uppercase" << endl;
    } else {
        cout << ch << " is neither lowercase not uppercase" << endl;
    }
    return 0;
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Consider permutations of the 26-character lowercase alphabet Σ={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}. In how many of these permutations do a,b,c...
Consider permutations of the 26-character lowercase alphabet Σ={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}. In how many of these permutations do a,b,c occur consecutively and in that order? In how many of these permutations does a appear before b and b appear before c?
3. a. For both (i) and (ii) below, use the first and second order conditions to...
3. a. For both (i) and (ii) below, use the first and second order conditions to find (and verify) the profit maximizing level of output and then find the level of profits associated with this quantity. This is a price taking firm in a perfectly competitive industry. b. For both (i) and (ii) below, find the minimum price at which each firm is willing to produce a positive level of output. Show all work. (i) P = $240, and C(q)...
I have to design an ordered list that tests to see if ions are in solution...
I have to design an ordered list that tests to see if ions are in solution or not. My ions are Ba+2, Pb+2, Zn+2 and my reagents are KI, Na2CO3, Na2SO4. I don't know how to order these properly on this chart. I think I start by adding KI and that shows me that a Ba+2 cation is present but I am really not sure. Can anyone help and or please explain the method behind the order of this chart?
Below statement is vague. Please elaborate in greater detail: I can see how some executives do...
Below statement is vague. Please elaborate in greater detail: I can see how some executives do take advantage of situations, but I also agree that some executives have worked very hard and have steered their careers well, in order to achieve the goal of being paid well. So for the ones that take complete advantage of the situation in order to fulfill their own greed, like the executives of Enron, they are completely in the wrong. But for those who...
ONLY NEED C) i and ii and D) i and ii ANSWERED PLEASE ZD&D holds a...
ONLY NEED C) i and ii and D) i and ii ANSWERED PLEASE ZD&D holds a patent on a unique medical device that is used for DNA mapping. Assume that ZD&D is a single-price profit-maximizing monopolist and is currently earning positive economic profits. (a) Draw a correctly labeled graph and show each of the following. (i) ZD&D’s profit-maximizing price and quantity, labeled as P* and Q*. (ii) The area representing ZD&D’s economic profits. (iii) The allocatively efficient level of output,...
For C++, how do I read through a file called "dictionary.txt" and see if the word...
For C++, how do I read through a file called "dictionary.txt" and see if the word user-inputted is in the file, but using cstring only and NOT string. For example, if the dictionary.txt is like Another ostentatious work extra dog camera hinder the output should look like this, Enter a word to be looked up in dictionary: cats cats is NOT in the dictionary. Enter a word to be looked up in dictionary: ostentatious ostentatious IS in the dictionary.
A 0.1987 g sample of an unknown Ni(II) salt was put into solution and properly treated...
A 0.1987 g sample of an unknown Ni(II) salt was put into solution and properly treated to form the solid nickel(II) dimethylglyoxime complex (molar mass = 288.917 g mol-1). When the precipitate was rinsed, dried, and cooled, it was determined to have a mass of 0.1763 g. Calculate the mass of nickel in the precipitate and the percent (by mass) of nickel in the original (unknown) salt sample. Please. Please show me detail work so that I understand this problem.If...
Please show all work. I need to see the formulas in order to understand the question...
Please show all work. I need to see the formulas in order to understand the question Thank you You are given the follwing information for Lighting. Co Debt: 7,500 bonds outstanding with a 7.8% coupon, $1,000 par value, 20 years to maturity, selling for 104 percent of par. These bonds make semiannually payments. Preferred Stock: 12,000 shares of 5.75% preferred stock outstanding, currently selling for a price of 2.0% below par per share. Common Stock: 210,000 shares outstanding, selling for...
***please use rstudio and describe how to answer this*** I am not learning to do this...
***please use rstudio and describe how to answer this*** I am not learning to do this by hand - a handwritten answer does not help me in the slightest. I need to know how do a hypothesis test in r but my professor did a very poor job of explaining it. An Office of Admission document at a certain university claims that 54.3% of their undergraduates are female. To test this claim, a random sample of 220 undergraduates was selected....
(i) Explain how scaling laws are important for Nanotechnology, (ii) Use scaling laws to show theoretically...
(i) Explain how scaling laws are important for Nanotechnology, (ii) Use scaling laws to show theoretically how scaling of an engine size affects the total power output, (iii) give a practical example of how scaling has real implications for the microelectronics industry.