
Funcitons and while loop
Presentation
•
Computers
•
University
•
Easy
Sandy BM
Used 7+ times
FREE Resource
13 Slides • 14 Questions
1
2
3
Open Ended
What subproblems do you identify in this problem?
4
Match
Write a mean function that receives 3 integers and returns the mean as a floating-point number.
Input
Process
Output
num1,num,num3
mean = (num1+num2+num3)/3
mean
num1,num,num3
mean = (num1+num2+num3)/3
mean
5
6
Match
Write a dispersion function that receives the standard deviation as a floating-point number and displays a message indicating that "the dispersion is low" if the standard deviation is less than 3, that "the dispersion is moderate" if the standard deviation is greater than or equal to 3 and less than 6, and that "the dispersion is high" when the standard deviation is greater than or equal to 6.
Input
if std <3: "low"
elif std <=6: "moderate"
else: "high"
Output
std
Process
"low"/"moderate"/"high"
std
Process
"low"/"moderate"/"high"
7
8
Match
Write a dispersion function that receives the standard deviation as a floating-point number and displays a message indicating that "the dispersion is low" if the standard deviation is less than 3, that "the dispersion is moderate" if the standard deviation is greater than or equal to 3 and less than 6, and that "the dispersion is high" when the standard deviation is greater than or equal to 6.
Input
if std <3: "low"
elif std < 6: "moderate"
else: "high"
Output
std
Process
"low"/"moderate"/"high"
std
Process
"low"/"moderate"/"high"
9
Open Ended
Write a dispersion function that receives the standard deviation as a floating-point number and displays a message indicating that "the dispersion is low" if the standard deviation is less than 3, that "the dispersion is moderate" if the standard deviation is greater than or equal to 3 and less than 6, and that "the dispersion is high" when the standard deviation is greater than or equal to 6.
10
Match
Design an algorithm that, given 3 numbers, calculates the mean, standard deviation, and indicates whether the data dispersion is low (less than 3), moderate (greater than or equal to 3 and less than 6), or high (greater than or equal to 6).
num1,num2,num3
Calculate the mean, calculate standard deviation, calculate dispersion
mean, standard deviation, dispersion message
Input
Process
Output
Input
Process
Output
11
Open Ended
Design an algorithm that, given 3 numbers, calculates the mean, standard deviation, and indicates whether the data dispersion is low (less than 3), moderate (greater than or equal to 3 and less than 6), or high (greater than or equal to 6).
12
13
14
15
Draw
error
?
16
17
Dropdown
18
Match
Design a function that, given two integers a and b, prints the values between a and b, incrementing by 3 if a is less than b, and by 4 if a is greater than b.
Input
Output
What is being repeated?
Where does it start?
Where does it end?
lower_l,upper_l
numerical sequence between a and b
Checking a<b and printing sequence
in a if a<b
or in b otherwise
in b if a<b
or in a otherwise
lower_l,upper_l
numerical sequence between a and b
Checking a<b and printing sequence
in a if a<b
or in b otherwise
in b if a<b
or in a otherwise
19
20
Open Ended
Complete the code so that it runs correctly, including the main() function and its call
21
Draw
Design a function that receives the upper and lower bounds of a closed range of integers and displays on the screen the numbers in this range that are simultaneously multiples of 5 and 7. For example, if the closed range with a lower bound of 35 and an upper bound of 140 is given as input, the output would be: 35, 70, 105, 140.
22
Open Ended
Complete the code so that it runs correctly, including the main() function and its call
23
Open Ended
Desing a function that reads strings until you read an “*”
24
25
26
27
Show answer
Auto Play
Slide 1 / 27
SLIDE
Similar Resources on Wayground
19 questions
Writing a Summary
Presentation
•
University
19 questions
B2 U4 Grammar
Presentation
•
University
20 questions
Sistema de Encendido
Presentation
•
University
20 questions
Computer Science and Engineering
Presentation
•
University
22 questions
Structured Analysis
Presentation
•
University
23 questions
Proportions: word problems
Presentation
•
University
20 questions
Untitled Presentation
Presentation
•
University
21 questions
Was Were
Presentation
•
University
Popular Resources on Wayground
20 questions
"What is the question asking??" Grades 3-5
Quiz
•
1st - 5th Grade
20 questions
“What is the question asking??” Grades 6-8
Quiz
•
6th - 8th Grade
10 questions
Fire Safety Quiz
Quiz
•
12th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
34 questions
STAAR Review 6th - 8th grade Reading Part 1
Quiz
•
6th - 8th Grade
20 questions
“What is the question asking??” English I-II
Quiz
•
9th - 12th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
47 questions
8th Grade Reading STAAR Ultimate Review!
Quiz
•
8th Grade
Discover more resources for Computers
15 questions
LGBTQ Trivia
Quiz
•
University
36 questions
8th Grade US History STAAR Review
Quiz
•
KG - University
25 questions
5th Grade Science STAAR Review
Quiz
•
KG - University
16 questions
Parallel, Perpendicular, and Intersecting Lines
Quiz
•
KG - Professional Dev...
20 questions
5_Review_TEACHER
Quiz
•
University
10 questions
Applications of Quadratic Functions
Quiz
•
10th Grade - University
10 questions
Add & Subtract Mixed Numbers with Like Denominators
Quiz
•
KG - University
20 questions
Block Buster Movies
Quiz
•
10th Grade - Professi...