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
Alika [10]
3 years 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:
Margarita [4]3 years ago
5 0

Answer:

The code is given below in python

# Code Block 1

count = 0  # count variable

total = 0  # total variable

enter = '' # input variable

while enter != 'stop':

   enter = input('Enter a grade:' )

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

       total += int(enter) # add to total value

       count = count + 1   # then 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
You start your car and begin to pull out of a parking space. After leaving the space, You notice that the brake light on your in
saw5 [17]
If your brake lights are staying on, it will drain your battery.The most likely cause for the brake lights staying on is the brake light switch sticking closed. You can disconnect the plug from the brake light switch at the brake light pedal to see if the lights turn off.

Hope it helped!
7 0
2 years ago
Which utility program reads an assembly language source file and produces an object file?
iragen [17]

Answer:

Assembler

Explanation:

An assembler can be define as a computer utility program that read, interpret and convert software programs written in low level assembly language into an object file, machine language, code and instruction that can be understood and executed by a computer.

5 0
3 years ago
A harmonic oscillator with spring constant, k, and mass, m, loses 3 quanta of energy, leading to the emission of a photon.
Monica [59]

Answer: (a). E = 3.1656×10³⁴ √k/m  

(b). f = 9.246 × 10¹² Hz

(c). Infrared region.

Explanation:

From Quantum Theory,

The energy of a proton is proportional to the frequency, from the equation;

E = hf

where E = energy in joules

h = planck's constant i.e. 6.626*10³⁴ Js

f = frequency

(a). from E = hf = 1 quanta

    f = ω/2π

where ω = √k/m

consider 3 quanta of energy is lost;

E = 3hf = 3h/2π × √k/m

E = (3×6.626×10³⁴ / 2π) × √k/m

E = 3.1656×10³⁴ √k/m    

(b). given from the question that K = 15 N/m

and mass M = 4 × 10⁻²⁶ kg

To get the frequency of the emitted photon,

Ephoton =hf = 3h/2π × √k/m (h cancels out)

f = 3h/2π × √k/m

f =  3h/2π × (√15 / 4 × 10⁻²⁶ )

f = 9.246 × 10¹² Hz

(c). The region of electromagnetic spectrum, the photon belongs to is the Infrared Spectrum because the frequency ranges from about 3 GHz to  400 THz in the electromagnetic spectrum.

6 0
3 years ago
Heating of Oil by Air. A flow of 2200 lbm/h of hydrocarbon oil at 100°F enters a heat exchanger, where it is heated to 150°F by
irakobra [83]

Answer:

2062 lbm/h

Explanation:

The air will lose heat and the oil will gain heat.

These heats will be equal in magnitude.

qo = -qa

They will be of different signs because one is entering iits system and the other is exiting.

The heat exchanged by oil is:

qo = Gp * Cpo * (tof - toi)

The heat exchanged by air is:

qa = Ga * Cpa * (taf - tai)

The specific heat capacity of air at constant pressure is:

Cpa = 0.24 BTU/(lbm*F)

Therefore:

Gp * Cpo * (tof - toi) = Ga * Cpa * (taf - tai)

Ga = (Gp * Cpo * (tof - toi)) / (Cpa * (taf - tai))

Ga = (2200 * 0.45 * (150 - 100)) / (0.24 * (300 - 200)) = 2062 lbm/h

5 0
3 years ago
A cylindrical specimen of a hypothetical metal alloy is stressed in compression. If its original and final diameters are 30.00 a
IrinaVladis [17]

Answer:

The original length of the specimen l_{o} = 104.7 mm

Explanation:

Original diameter d_{o} = 30 mm

Final diameter d_{1} = 30.04 mm

Change in diameter Δd = 0.04 mm

Final length l_{1} = 105.20 mm

Elastic modulus E = 65.5 G pa = 65.5 × 10^{3} M pa

Shear modulus G = 25.4 G pa = 25.4 × 10^{3} M pa

We know that the relation between the shear modulus & elastic modulus is given by

G = \frac{E}{2(1 + \mu)}

25.5 = \frac{65.5}{2 (1 + \mu)}

\mu = 0.28

This is the value of possion's ratio.

We know that the possion's ratio is given by

\mu = \frac{\frac{0.04}{30} }{\frac{change \ in \ length}{l_{o} } }

{\frac{change \ in \ length}{l_{o} } = \frac{\frac{0.04}{30} }{0.28}

{\frac{change \ in \ length}{l_{o} } = 0.00476

\frac{l_{1} - l_{o}  }{l_{o}  } = 0.00476

\frac{l_{1} }{l_{o} } = 1.00476

Final length l_{o} = 105.2 m

Original length

l_{o} = \frac{105.2}{1.00476}

l_{o} = 104.7 mm

This is the original length of the specimen.

5 0
3 years ago
Other questions:
  • What is a two stroke engine and what is a four stroke engine, please keep the definitions as simple as can be and please explain
    8·2 answers
  • Alberta Einstein teaches a business class at Podunk University. To evaluate the students in this class, she has given three test
    13·1 answer
  • Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the array's
    11·1 answer
  • A wine aerator is a small, in-bottle, hand-held pour-through or decantor top device using the venturi effect for aerating the wi
    9·1 answer
  • FREEEEEE POOIIIINTS RIGHT HERE EVERYONE LEVEL UPPPP​
    13·2 answers
  • The typical Canadian worker is able to produce 100 board feet (a unit of measure) of lumber or 1000 light bulbs per year. The wo
    12·1 answer
  • WILL MARK BRAINLIST I need help on this asap thanks
    15·1 answer
  • Resistors of 150 Ω and 100 Ω are connected in parallel. What is their equivalent resistance?
    13·1 answer
  • A fine-grained soil has a liquid limit of 200%, determined from the Casagrande cup method. The plastic limit was measured by rol
    15·1 answer
  • The majority of adults now own smartphones or tablets, and most of them say they use them in part to get the news. From 2004 to
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!