1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dmitriy789 [7]
3 years ago
8

Write an application named EnterUppercaseLetters that asks the user to type an uppercase letter from the keyboard. If the charac

ter 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. C# C# C#
Engineering
1 answer:
ozzi3 years ago
6 0

Answer:

The solution code is given below

  1. using System;
  2. using System.Linq;
  3.      
  4. public class Program
  5. {
  6. public static void Main()
  7. {
  8.  string[] letters = {"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"};
  9.  
  10.  Console.WriteLine("Please input a letter: ");
  11.  string input_letter = Console.ReadLine();
  12.  
  13.  if(letters.Contains(input_letter)){
  14.   Console.WriteLine("OK");
  15.  }else{
  16.   Console.WriteLine("Error. Not uppercase letter.");
  17.  }  
  18. }
  19. }

Explanation:

Firstly we import the necessary libraries, System and Linq (Line 1-2).

Next we create a string array to hold all uppercase letters (Line 8).

Next, we prompt user to input a letter using the ReadLine() method (Line 10 - 11)

At last, we define if and else conditions to check if the letters contains the input letter. If so, print ok else print an error message. (Line 13-17)

You might be interested in
Tires can be recycled instead of thrown out.<br> True<br> False
Arisa [49]

Answer:

True :)

Explanation:

You can recycle it! Tire recycling is the most practical and environment-friendly way of disposing of old and worn-out tires. Due to their inherent durability, large volume and environment and health risks, tires are one of the most problematic sources of solid wastes.

Hope it helped have a nice day! :)

8 0
3 years ago
Who here is a genius?
Pachacha [2.7K]

Answer:

im kinda smart  whyy?

Explanation:

3 0
3 years ago
Read 2 more answers
A large fraction of the thermal energy generated in the engine of a car is rejected to the air by the radiator through the circu
Rina8888 [55]
Open system because there is mass (water) flowing through the system of interest (radiator)
5 0
3 years ago
Now that we have a second enemy, you will need to make some changes to the script that is attached to your backdrop. Look at tha
JulsSmile [24]

Answer:

<u><em>≡</em></u>

Explanation:

8 0
3 years ago
Multiple Choice
katrin [286]

Answer:

Zoning is like a hammer because it is used as a tool for urban planning.

8 0
3 years ago
Other questions:
  • During an office party, an office worker claims that a can of cold beer on his table warmed up to 20oC by picking up energy from
    13·1 answer
  • Water at 20 °C is flowing with velocity of 0.5 m/s between two parallel flat plates placed 1 cm apart. Determine the distances f
    5·1 answer
  • 3- A cylinder with 0.4kg of Nitrogen gas at 27ºC keeps under pressure by a frictionless piston. Weight of this piston will incre
    6·1 answer
  • 2. In the above figure, what type of cylinder arrangement is shown in the figure above?
    9·2 answers
  • What is this i dont understand this at all
    9·1 answer
  • I need help with this I dont know the word ​
    10·2 answers
  • Best known for his invention of the pressure-ignited heat engine that bears his name,
    5·1 answer
  • Architecture reflects multidisciplinary
    13·1 answer
  • Find the mean deviation of the set of numbers<br> (a) 12, 6, 7, 3, 15, 10, 18,5
    7·2 answers
  • 4. What are these parts commonly called?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!