Q:

Write an application named EnterUppercaseLetters that asks the user to type an uppercase letter from the keyboard. If the character entered is an uppercase letter, display OK; if it is not an uppercase letter, display an error message

0

Write an application named EnterUppercaseLetters that asks the user to type an uppercase letter from the keyboard. If the character entered is an uppercase letter, display OK; if it is not an uppercase letter, display an error message. The program continues until the user types an exclamation point.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;

namespace EnterUppercaseLetters
{
    class EnterUppercaseLetters
    {
        static void Main(string[] args)
        {
            WriteLine("EnterUppercaseLetters");
            char entry = '0';
            while (entry != '!')
            {
                Write("Enter uppercase letter:");
                entry = char.Parse(ReadLine());
                if (entry >= 'A' && entry <= 'Z')
                    WriteLine("*OK*");
                else
                    WriteLine("Thats not an uppercase letter");
            }

            WriteLine("--End--");
        }
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now