Skip to content

Commit ec0c42a

Browse files
rwdouglavulder
andauthored
Introduces topic for Passing Parameters by Value (#72)
resolves #38 Co-authored-by: Florian Sattler <[email protected]>
1 parent c95c9cf commit ec0c42a

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Module name: Passing Parameters by Value
2+
_Skeleton descriptions are typeset in italic text,_
3+
_so please don't remove these descriptions when editing the topic._
4+
5+
## Overview
6+
7+
_Provides a short natural language abstract of the module’s contents._
8+
_Specifies the different levels of teaching._
9+
10+
<table>
11+
<thead>
12+
<th>Level</th>
13+
<th>Objectives</th>
14+
</thead>
15+
<tr>
16+
<td>Foundational</td>
17+
<td>Defining and calling functions with values</td>
18+
</tr>
19+
<tr>
20+
<td>Main</td>
21+
<td></td>
22+
</tr>
23+
<tr>
24+
<td>Advanced</td>
25+
<td></td>
26+
</tr>
27+
</table>
28+
29+
## Motivation
30+
31+
_Why is this important?_
32+
_Why do we want to learn/teach this topic?_
33+
34+
The fundamental element for code-reuse is a function. For functions to be
35+
useful, we need to parameterize them. Understanding how to do such is thus
36+
fundamental to programming in any language.
37+
38+
## Topic introduction
39+
40+
_Very brief introduction to the topic._
41+
42+
Explain how to define functions with parameters and call them with values.
43+
44+
## Foundational: Using reference types to avoid copies
45+
46+
### Background/Required Knowledge
47+
48+
A student is able to:
49+
50+
* Explain what a function is
51+
52+
### Student outcomes
53+
54+
_A list of things "a student should be able to" after the curriculum._
55+
_The next word should be an action word and testable in an exam._
56+
_Max 5 items._
57+
58+
A student should be able to:
59+
60+
1. Call a function with any number of parameters using the same number of arguments
61+
2. Define a function with any number of parameters
62+
63+
### Caveats
64+
65+
_This section mentions subtle points to understand, like anything resulting in
66+
implementation-defined, unspecified, or undefined behavior._
67+
68+
### Points to cover
69+
70+
_This section lists important details for each point._
71+
72+
* A function is called by invoking the name of the function, followed by parentheses
73+
* For each parameter in the function signature, a value must be provided, and in the same order
74+
* Multiple values passed to a function are comma-separated
75+
* When defining a function, you must list the parameters with the type first, and parameter name second
76+
77+
## Main: Using references to modify external data
78+
79+
### Background/Required Knowledge
80+
81+
### Student outcomes
82+
83+
### Caveats
84+
85+
### Points to cover
86+
87+
## Advanced
88+
89+
_These are important topics that are not expected to be covered but provide
90+
guidance where one can continue to investigate this topic in more depth._
91+

0 commit comments

Comments
 (0)