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
Remember from Lab 3C that Mad Libs are activities that have a person provide various words, which are then used to complete a sh
Harlamova29_29 [7]

Answer:

Python code is explained below

Explanation:

CODE(TEXT): -

9A.py:-

def sentence(): #function to read input and display

  name = input("Enter a name: ") #input name

  place = input("Enter a place: ") #input place

  number = int(input("Enter a number: ")) #input number typecasted to int

  noun = input("Enter a plural noun: ") #input plural noun

  adjective = input("Enter an adjective: ") #input adjective

  print("\n{} went to {} to buy {} different types of {}".format(name, place, number, noun)) #format is used to display o/p

  print("but unfortunately, the {} were all {} so {} went back to {} to return them.\n".format(noun, adjective,name, place))

op = "n" #initially op = n i.e. user not wanting to quit

while op != "y" : #while user does not input y

  sentence() #input words from user

  op = input("Do you want to quit [y/n]? ") #prompt to continue or quit

  if op == "y": #if yes then print goodbye and exit

      print("Goodbye")

      break

  else: #else print newline and take input

      print("")

9B.py: -

#inputs are strings by default applying a split() function to a string splits it into a list of strings

#then with the help of map() function we can convert all the strings into integers

numbers = list(map(int, input("Enter the input: ").split()))

sum = 0 #sum is initially 0

for i in range(len(numbers)): #loops for all the elements in the list

  sum = sum + numbers[i] #add the content of current element to sum

avg = sum/ len(numbers) #average = (sum of all elements)/ number of elements in the list

max = numbers[0] #initially max = first number

for i in range(1, len(numbers)): #loops for all remaining elements

  if numbers[i] > max : #if their content is greater than max

      max = numbers[i] #update max

print("The average and max are: {:.2f} {}".format(avg, max)) #format is used to print in formatted form

#.2f is used to print only 2 digits after decimals

9C.py: -

#inputs are strings by default applying a split() function to a string splits it into a list of strings

#then with the help of map() function we can convert all the strings into integers

numbers = list(map(int, input("Enter a list of numbers: ").split()))

numbers = [elem for elem in numbers if elem >= 0] #using list comprehension

#loops for all elements of the list and keep only those who are >= 0

numbers.sort() #list inbuilt function to sort items

print("The non-negative and sorted numbers are: ", end = "")

for num in numbers: #for all numbers in the list print them

  print("{} ".format(num), end = "")

7 0
3 years ago
As shown, a load of mass 10 kg is situated on a piston of diameter D1 = 140 mm. The piston rides on a reservoir of oil of depth
telo118 [61]

Answer:

165 mm

Explanation:

The mass on the piston will apply a pressure on the oil. This is:

p = f / A

The force is the weight of the mass

f = m * a

Where a in the acceleration of gravity

A is the area of the piston

A = π/4 * D1^2

Then:

p = m * a / (π/4 * D1^2)

The height the oil will raise is the heignt of a colum that would create that same pressure at its base:

p = f / A

The weight of the column is:

f = m * a

The mass of the column is its volume multiplied by its specific gravity

m  = V * S

The volume is the base are by the height

V = A * h

Then:

p = A * h * S * a / A

We cancel the areas:

p = h * S * a

Now we equate the pressures form the piston and the pil column:

m * a / (π/4 * D1^2) = h * S * a

We simplify the acceleration of gravity

m / (π/4 * D1^2) = h * S

Rearranging:

h = m / (π/4 * D1^2 * S)

Now, h is the heigth above the interface between the piston and the oil, this is at h1 = 42 mm. The total height is

h2 = h + h1

h2 = h1 + m / (π/4 * D1^2 * S)

h2 = 0.042 + 10 / (π/4 * 0.14^2 * 0.8) = 0.165 m = 165 mm

7 0
2 years ago
A turbine operates at steady state, and experiences a heat loss. 1.1 kg/s of water flows through the system. The inlet is mainta
strojnjashka [21]

Answer:

\dot W_{out} = 399.47\,kW

Explanation:

The turbine is modelled after the First Law of Thermodynamics:

-\dot Q_{out} -\dot W_{out} + \dot m\cdot (h_{in}-h_{out}) = 0

The work done by the turbine is:

\dot W_{out} = \dot m \cdot (h_{in}-h_{out})-\dot Q_{out}

The properties of the water are obtained from property tables:

Inlet (Superheated Steam)

P = 10\,MPa

T = 520\,^{\textdegree}C

h = 3425.9\,\frac{kJ}{kg}

Outlet (Superheated Steam)

P = 1\,MPa

T = 280\,^{\textdegree}C

h = 3008.2\,\frac{kJ}{kg}

The work output is:

\dot W_{out} = \left(1.1\,\frac{kg}{s}\right)\cdot \left(3425.9\,\frac{kJ}{kg} -3008.2\,\frac{kJ}{kg}\right) - 60\,kW

\dot W_{out} = 399.47\,kW

5 0
3 years ago
Select the right answer<br>​
Kruka [31]

Answer:

for 1st question the answer is 5th option.

for 2nd question the answer is 2nd option

hope it helps you mate

please mark me as brainliast

5 0
3 years ago
What are the benefits of using the engineering design process
Shalnov [3]

Answer:

Some of the benefits are tangible for they are visible in the design and production process, while the other benefits are intangible which may not be visible directly but result in improvement in the quality of product, better control over designing and production process, reduction of stress on the designers etc.

7 0
2 years ago
Other questions:
  • The manufacturer of a 1.5 V D flashlight battery says that the battery will deliver 9 {\rm mA} for 37 continuous hours. During t
    10·1 answer
  • The wet density of a sand was found to be 1.9 Mg/m3 and the field water content was 10%. In the laboratory, the density of solid
    9·1 answer
  • Choose the true statement from those shown below: A Merchant Account allows you to use SSL on your web site. Disadvantages of us
    14·1 answer
  • How do scientists and engineers use math to help them?
    14·1 answer
  • Create a program named IntegerFacts whose Main() method declares an array of 10 integers.Call a method named FillArray to intera
    12·1 answer
  • he Weather Channel reports that it is a hot, muggy day with an air temperature of 90????F, a 10 mph breeze out of the southwest,
    6·1 answer
  • An incompressible fluid flows along a 0.20-m-diameter pipe with a uniform velocity of 3 m/s. If the pressure drop between the up
    15·1 answer
  • Technician A says that latent heat is hidden heat and cannot be measured on a thermometer. Technician B says that latent heat is
    12·1 answer
  • Name the four ways in which heat is transferred from a diesel engine
    7·1 answer
  • There are signs of oil spray on the compressor clutch hub and nearby underhood areas. Technician A says that a faulty compressor
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!