answer.
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
natima
1 month ago
7

You want to know your grade in Computer Science, so write a program that continuously takes grades between 0 and 100 to standard

input until you input "stop", at which point it should print your average to standard output. Instructor Notes: Make sure to initialize counter and total to 0 Read the grades between 0 and 100: grade = input() Use while loop as long as the grades input is not equal to "stop" Make sure to total int(grades) Increment counter by one input the grade again Finally, print the average: total/counter
Engineering
1 answer:
grin007 [219]1 month ago
5 0

Answer:

Below is the code provided in Python.

# Code Block 1

count = 0  # variable for counting

total = 0  # variable for total

enter = '' # variable for input

while enter!= 'stop':

   enter = input('Enter a grade:' )

   if enter!= 'stop' and enter.isdigit():

       total += int(enter) # adding to the total amount

       count += 1   # then adding to the count

print float(total) / count

# Code Block 2

numbers = []

while enter!= 'stop':

   enter = input('Enter a grade:' )

   if enter!= 'stop':

       numbers.append(int(enter))

print sum(numbers) / float(len(numbers))

You might be interested in
Consider a process carried out on 1.00 mol of a monatomic ideal gas by the following two different pathways.
grin007 [219]

Answer:

90 L.atm

Explanation:

According to the provided details:

First pathway:

A( 3 atm, 20 L) → C ( 1 atm, 20 L) → D (1 atm, 50 L)

Second pathway:

A(3 atm, 20 L) → B( 3 atm, 50 L) → D ( 1 atm, 50 L)

As the number of moles is 1.00 moles

To calculate wAB;

A → B signifies the transformation is happening at a steady pressure;

Thus,

wAB = pressure multiplied by the change in volume

wAB = P(V₂ - V₁)

wAB = 3 atm (50 L - 20 L)

wAB = 3 atm (30 L)

wAB = 90 L.atm

7 0
17 days ago
A bar of 75 mm diameter is reduced to 73mm by a cutting tool while cutting orthogonally. If the mean length of the cut chip is 7
mote1985 [204]

Answer:

r=0.31

Ф=18.03°

Explanation:

Provided:

Original diameter of bar = 75 mm

Diameter post-cutting = 73 mm

Average diameter of the bar d= (75+73)/2=74 mm

Average length of uncut chip = πd

Average length of uncut chip = π x 74 =232.45 mm

Thus, cutting ratio r

Cutting\ ratio=\dfrac{Mean\ length\ of cut\ chip}{Mean\ length\ of uncut\ chip}

r=\dfrac{73.5}{232.45}   r=0.31

Therefore, the cutting ratio equals 0.31.

Now, the shearing angle is given as

tan\phi =\dfrac{rcos\alpha }{1-rsin\alpha }

Next by substituting the values

tan\phi =\dfrac{rcos\alpha }{1-rsin\alpha }

tan\phi =\dfrac{0.31cos15 }{1-0.31sin15 }\

Ф=18.03°

Concluding, the shearing angle is 18.03°.

4 0
1 month ago
A well-insulated rigid tank contains 1.5 kg of a saturated liquid–vapor mixture of water at 200 kPa. Initially, three-quarters o
Daniel [215]

Answer:

The change in entropy of the steam is 2.673 kJ/K

Explanation:

The mass of the liquid-vapor mixture is 1.5 kg

The mass in the liquid phase is calculated as 3/4 × 1.5 kg = 1.125 kg

The mass in the vapor phase is calculated as 1.5 - 1.125 = 0.375 kg

According to the steam tables

At a pressure of 200 kPa (200/100 = 2 bar), the specific entropy of steam is found to be 7.127 kJ/kgK

The entropy of steam can be calculated as specific entropy multiplied by mass = 7.127 × 0.375 = 2.673 kJ/K

6 0
1 day ago
Read 2 more answers
Given num_rows and num_cols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
Viktor [230]

Answer:

This is the solution code in Python:

  1. alphabets = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
  2. user_input = input("Enter number of rows and columns: ")
  3. myArr = user_input.split(" ")
  4. num_rows = int(myArr[0])
  5. num_cols = int(myArr[1])
  6. seats = []
  7. for i in range(num_rows):
  8. row = []
  9. for j in range(num_cols):
  10. row.append(alphabets[j])
  11. seats.append(row)
  12. output = ""
  13. for i in range(len(seats)):
  14. for j in range(len(seats[i])):
  15. output += str(i + 1) + seats[i][j] + " "
  16. print(output)

Explanation:

Initially, we create a small list of alphabets from A to J (Line 1).

We then request the user to enter the number of rows and columns (Line 3). Given that the input comes as a string (e.g., "2 3"), we utilize the split() method to separate the numbers into individual items in a list (Line 4). The first item (row number) is assigned to variable num_rows, while the second item (column number) goes to num_cols.

Subsequently, we construct the seats list with a nested for-loop (Lines 10-15). Once the seats list is formed, another nested for-loop generates the required output string as per the question (Lines 19-21).

Finally, the output is printed (Line 23). For example, an input of 2 3 results in the output:

1A 1B 1C 2A 2B 2C

8 0
1 month ago
Design a decimal arithmetic unit with two selection variables, V1, and Vo, and two BCD digits, A and B. The unit should have fou
choli [191]
Ucsaaaaauxx627384772938282’cc ed un e uff ridicolizzarla +golfista
4 0
27 days ago
Other questions:
  • A sign erected on uneven ground is guyed by cables EF and EG. If the force exerted by cable EF at E is 46 lb, determine the mome
    13·1 answer
  • Degreasers can be broken down into two main categories
    9·2 answers
  • Your employer has the ability to protect you from cave-ins and other hazards by using adequately-designed protection systems in
    13·1 answer
  • A certain full-wave rectifier has a peak output voltage of 30 V. A 50 mF capacitor-input filter is connected to the rectifier. C
    6·1 answer
  • A long, circular aluminum rod is attached at one end to a heated wall and transfers heat by convection to a cold fluid.
    12·1 answer
  • Marble A is placed in a hollow tube, and the tube is swung in a horizontal plane causing the marble to be thrown out. As viewed
    11·1 answer
  • A pipe in a district heating network is transporting over-pressurized hot water (10 atm) at a mass flow of 0.5 kg/s. The pipe is
    14·1 answer
  • Consider a rectangular fin that is used to cool a motorcycle engine. The fin is 0.15m long and at a temperature of 250C, while t
    5·1 answer
  • The electrical panel schedules are located on EWR Plan number ___.
    13·1 answer
  • 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
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!