You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
!include`snippetStart="// This Test1 method would not compile",snippetEnd="// Uncomment Test1 to see for yourself."` code/projects/ReferenceMethods/ReferenceMethods/Program.cs
47
35
```
48
36
49
37
- [ ] A method cannot be `static` and have `void` as a return type.
50
38
- [x] Any `out` parameter must have its value set in the body of the method.
51
39
- [ ] The `else` is missing.
40
+
- [ ] C# assumes that `out` parameters do not have a value.
52
41
- [ ] The keyword `out` cannot be used in the header of a method.
53
42
- [ ] An `out` parameter cannot be assigned a value.
!include`snippetStart="// This Test2 method would not compile",snippetEnd="// Uncomment Test2 to see for yourself."` code/projects/ReferenceMethods/ReferenceMethods/Program.cs
48
+
```
49
+
50
+
- [ ] A method cannot be `static` and have `void` as a return type.
51
+
- [ ] Any `out` parameter must have its value set in the body of the method.
52
+
- [x] C# assumes that `out` parameters do not have a value.
53
+
- [ ] The keyword `out` cannot be used in the header of a method.
54
+
- [ ] An `out` parameter cannot be assigned a value.
!include`snippetStart="// Example for NameChange",snippetEnd="// End of NameChange example"` code/projects/ReferenceMethods/ReferenceMethods/Program.cs
90
+
```
95
91
96
92
Assume given a `string` `name` variable containing a value. Write a short program (possibly declaring additional variables) that
93
+
97
94
#. Asks the user their new name,
98
95
#. Calls the `NameChange` method with appropriate arguments,
99
96
#. Displays the new name and the old name.
100
97
101
-
## Problems
102
-
103
-
#. Write the `AddRev` method (header included) such that the following:
104
-
105
-
```
106
-
!include`snippetStart="// Example for AddRev",snippetEnd="// Solution for AddRev"` code/projects/ReferenceMethods/ReferenceMethods/Program.cs
!include`snippetStart="// This previous string is assumed given.",snippetEnd="// End of NameChange usage example"` code/projects/ReferenceMethods/ReferenceMethods/Program.cs
101
+
```
119
102
</details>
120
-
103
+
104
+
105
+
## Problems
106
+
121
107
#. Write the `AddLog` method (header included) such that the following:
0 commit comments