
Week 6 - Functions (DCS1101)
Presentation
•
Computers
•
University
•
Practice Problem
•
Medium
Yasmin Basiran
Used 6+ times
FREE Resource
22 Slides • 13 Questions
1
2
3
Poll
If you had to check “Pass/Fail” for 10 students, would you rather copy the code 10 times or reuse something?
Copy code 10 times
Reuse something
4
Open Ended
Why do humans divide work into roles?
5
6
7
8
9
10
11
12
13
14
15
Multiple Choice
What is the main purpose of a function?
16
Multiple Choice
Where is a function prototype usually written?
17
Multiple Choice
Passing data by value means:
18
Multiple Choice
What does the return statement do?
The return statement exits a function and returns a value.
19
20
21
22
23
24
25
Multiple Choice
What is the best way to explain a global variable?
26
Multiple Choice
Which error happens if return type mismatches?
Compilation error
27
28
29
Open Ended
Write a function that displays a welcome message "Hello!".
30
Open Ended
Write a function that returns true if a score above 50 is a pass.
31
Multiple Choice
What is the error of this code?
int total() {
return "10";
}
32
Open Ended
What is the error of this code?
int add(int a, int b) {
cout << a + b;
}
33
Multiple Choice
What happens if a function has return type int but no return statement?
34
35
Show answer
Auto Play
Slide 1 / 35
SLIDE
Similar Resources on Wayground
31 questions
Quiz3+4_TINHOCFA20
Presentation
•
University
26 questions
Reproduksi Naskah
Presentation
•
University
28 questions
Review of Verb Tenses
Presentation
•
University
26 questions
Normalización
Presentation
•
University
32 questions
Vivobook A M3401 OLED
Presentation
•
University
32 questions
Quiz5+6_TINHOCFA20
Presentation
•
University
29 questions
Ciudadanía Digital
Presentation
•
University
31 questions
CAIT2 - Seatwork 15
Presentation
•
University
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade