computing Flashcards

(6 cards)

1
Q

i

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

while snowfal measurment is not = 0

Initialized Variables
dayCount = 0
snowfalMeasure = 1
measureCount = 0
amount = []
falTotal = 0
snowfalMeasure = float(input(“Enter the snowfall (in cm): “))
# get valid snowfal measurement
while snowfalMeasure != 0:
snowfalMeasure = float(input(“Enter the snowfall (in cm): “))
while snowfalMeasure <0 and snowfalMeasure >60:
snowfalMeasure = float(input(“Try again.Your value msut be between 0 and 60: “))
# if snowfall measurement >=0.5
if snowfalMeasure >=0.5:
# store snowfal measurement
amount.append(snowfalMeasure)
#add snowfall measurement to snowfalltotal
falTotal = snowfalMeasure + falTotal
# add 1 to measurement counter
measurementCounter = + 1
#if snowfall measurement is not = 0
if snowfalMeasure != 0:
# add 1 to measurementCounter
dayCounter = + 1
#Calculate the average of all stored snowfall measurements
average = falTotal / measureCount
# store the average to 2 decimal places
round_avg = round(average,2)
print(round_avg)

if snow
if falTotal >=10.0 and dayCount >=5:
# Output messages
print(“The number of days lasted was”, dayCount)
print(dayCount, “Were not included in the calaculations”)
print(“The”, snowfalMeasure,”stored were as follows:”)
print(“The average of the stored measurements”, round_avg)
else:
print(“Not enough data for anaysis”)

A

Initialized Variables
get valid snowfal measurement
if snowfall measurement >=0.5
store snowfal measurement
add snowfall measurement to snowfalltotal
add 1 to measurement counter
if snowfall measurement is not = 0
add 1 to measurementCounter

Initialized Variables

get valid snowfal measurement
# if snowfall measurement >=0.5
if snowfalMeasure >=0.5:
# store snowfal measurement
#add snowfall measurement to snowfalltotal
# add 1 to measurement counter
measurementCounter = + 1
#if snowfall measurement is not = 0
# add 1 to measurementCounter
dayCounter = + 1
#Calculate the average of all stored snowfall measurements
# store the average to 2 decimal places
if falTotal >=10.0 and dayCount >=5:
# Output messages
print(“The number of days lasted was”, dayCount)
print(dayCount, “Were not included in the calaculations”)
print(“The”, snowfalMeasure,”stored were as follows:”)
print(“The average of the stored measurements”, round_avg)
else:
print(“Not enough data for anaysis”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Enter the snowfall (in cm): 5.01
Enter the snowfall (in cm): 0.22
Enter the snowfall (in cm): 70.3
Enter the snowfall (in cm): 0.48
Enter the snowfall (in cm): 4.9
Enter the snowfall (in cm): 1.14
Enter the snowfall (in cm): 0

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Initialized Variables
dayCount = 0
snowfalMeasure = 1
measureCount = 0
amount = []
falTotal = 0
# while snowfal measurment is not = 0
snowfalMeasure = float(input(“Enter the snowfall (in cm): “))
# get valid snowfal measurement
while snowfalMeasure != 0:
snowfalMeasure = float(input(“Enter the snowfall (in cm): “))
while snowfalMeasure <0 and snowfalMeasure >60:
snowfalMeasure = float(input(“Try again.Your value msut be between 0 and 60: “))
# if snowfall measurement >=0.5
if snowfalMeasure >=0.5:
# store snowfal measurement
amount.append(snowfalMeasure)
#add snowfall measurement to snowfalltotal
falTotal = snowfalMeasure + falTotal
# add 1 to measurement counter
measurementCounter = + 1
# snowfall measurement validation
if snowfalMeasure != 0:
# add 1 to measurementCounter
dayCounter = + 1
#Calculation of the average of all stored snowfall measurements
average = falTotal / measureCount
# store the average to 2 decimal places
round_avg = round(average,2)
print(round_avg)

if snow
if falTotal >=10.0 and dayCount >=5:
# Output messages
print(“The number of days lasted was”, dayCount)
print(dayCount, “Were not included in the calaculations”)
print(“The”, snowfalMeasure,”stored were as follows:”)
print(“The average of the stored measurements”, round_avg)
else:
print(“Not enough data for anaysis”)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Initialized Variables

dayCount = 0
measureCount = 0
amount = []
falTotal = 0
snowfalMeasure = float(input(“Enter the snowfall (in cm): “))
# get valid snowfal measurement
while snowfalMeasure != 0:
while snowfalMeasure <0 or snowfalMeasure >60:
snowfalMeasure = float(input(“Try again.Your value must be between 0 and 60: “))
# if snowfall measurement >=0.5
if snowfalMeasure >=0.5:
# store snowfal measurement
amount.append(snowfalMeasure)
#add snowfall measurement to snowfalltotal
falTotal = snowfalMeasure + falTotal
# add 1 to measurement counter
measureCount = measureCount + 1
# snowfall measurement validation
if snowfalMeasure != 0:
# add 1 to measureCount
dayCount = dayCount + 1
snowfalMeasure = float(input(“Enter the snowfall (in cm): “))
#Calculation of the average of all stored snowfall measurements
if measureCount >0:
average = falTotal / measureCount
# store the average to 2 decimal places
round_avg = round(average,2)
print(round_avg)

if falTotal >=10.0 and dayCount >=5:
# Output messages
print(“The number of days lasted was”, dayCount)
print(dayCount, “Were not included in the calaculations”)
print(“The”, snowfalMeasure,”stored were as follows:”)
print(“The average of the stored measurements”, round_avg)
else:
print(“Not enough data for anaysis”)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly