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]
2 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:
ozzi2 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
A city is experiencing a windstorm. The wind has blown away some of the houses in that city. What load bearing factor did the ar
yuradex [85]

Answer:

oa

Explanation:

6 0
2 years ago
Adam has 5 barrels of different volumes. The barrel of which volume can contain the most liquid?
Natalija [7]

Answer:

D

Explanation:

5 0
2 years ago
An inductor and resistor are connected in parallel to a 120-V, 60-Hz line. The resistor has a resistance of 50 ohms, and the ind
BARSIC [14]

Answer:

hi

Explanation:

the answer would be I dont know

6 0
3 years ago
1 import java.util.Scanner; 3 public class EqualityAndRelational { 4 public static void main (String args) args) { int userBonus
Anastaziya [24]

Missing Part of the Question

Complete the expression so that userPoints is assigned with 0 if userBonus is greater than 20 (second branch). Otherwise, userPoints is assigned with 10 (first branch

import java.util.Scanner;

public class EqualityAndRelational {

public static void main (String args) args) {

int userBonus; int userPoints;

userPoints=0;

Scanner scnr = new Scanner(System.in);

userBonus = scnr.nextInt();

// Program will be tested with values : 15, 20, 25, 30, 35. 12 13 14 15 16 17 18 19

( Your solution goes here)

{

userPoints= 10 ;

}

else {

userPoints = 0;

}

}

}

Answer;

Replace

( Your solution goes here)

With

if(userBonus>20).

The full program becomes

import java.util.Scanner;

public class EqualityAndRelational {

public static void main (String args) args) {

int userBonus; int userPoints;

userPoints=0;

Scanner scnr = new Scanner(System.in);

userBonus = scnr.nextInt();

// Program will be tested with values : 15, 20, 25, 30, 35. 12 13 14 15 16 17 18 19

if(userBonus>20)

{

userPoints= 10 ;

}

else {

userPoints = 0;

}

}

}

7 0
3 years ago
Lobbyists are hired by companies to influence legislation to meet a company's goals. They ask for things needed to program plans
denis-greek [22]
Social media groups. So c
8 0
3 years ago
Read 2 more answers
Other questions:
  • 99 POINTS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    15·2 answers
  • A car accelerates uniformly from rest to 60 km/h in 30 s. What is its displacement during this time?
    7·1 answer
  • A motor driven water pump operates with an inlet pressure of 96 kPa (absolute) and mass flow rate of 120 kg/min. The motor consu
    7·1 answer
  • True or False: Stress can effectively be relieved through physical activity, getting enough rest and sleep, and relaxation techn
    7·2 answers
  • Help me asap I rely need help u will be my fav​
    8·2 answers
  • A center-point bending test was performed on a 2 in. x d in. wood lumber according to ASTM D198 procedure with a span of 4 ft an
    12·1 answer
  • Their game off badminton is always on Tuesday
    11·1 answer
  • Explain why the following scenario fails to meet the criteria for proper reverse engineering.
    14·1 answer
  • A technician needs to check the heating operation of a heat pump that has no gauge access ports. The technician should start by:
    9·1 answer
  • X cotx expansion using maclaurins theorem.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!