Skip to content

Commit 5f52838

Browse files
committed
fixes in the exercises for the "Methods" chapter
1 parent b93e50b commit 5f52838

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

Content/Chapter-10-methods/exercises-methods/integer-to-base.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Write a method **`IntegerToBase(number, toBase)`**, which takes as parameters an
1010

1111
## Hints and Guidelines
1212

13-
In order to solve the problem we will declare a string, in which we will keep the result. After this we need to do the following calculations to convert the number.
13+
In order to solve the problem, we will declare a string, in which we will keep the result. After this we need to do the following calculations to convert the number.
1414
* Calculate **the remainder** of the number, divided by the base.
1515
* **Insert the remainder** in the beginning of the string.
1616
* **Divide** the number to the base.

Content/Chapter-10-methods/exercises-methods/notifications.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Problem: Notifications
22

3-
Write a program, which takes an integer **`n`** and on the next lines prints **`n`** **messages** (for each message read a few lines). Each message starts with **`messageType`**: **`success`**, **`warning`** or **`error`**:
4-
- When **`messageType`** is **`success`** read **`operation`** + **`message`** (each on a new line).
5-
- When **`messageType`** is **`warning`** read only **`message`**.
6-
- When **`messageType`** is **`error`** read **`operation`** + **`message`** + **`errorCode`** (each on a new line).
3+
Write a program, which takes an integer **`n`** and **`n` input messages** and prints **`n` output messages**, based on the input. For each message read a few lines. Each message starts with **`messageType`**: **`success`**”, “**`warning`** or **`error`**:
4+
- When **`messageType`** is **`success`** read **`operation`** + **`message`** (each from a new line).
5+
- When **`messageType`** is **`warning`** read only **`message`** (from a new line).
6+
- When **`messageType`** is **`error`** read **`operation`** + **`message`** + **`errorCode`** (each from a new line).
77

88
Print on the console **each read message**, formatted depending on its **`messageType`**. After the headline of the message print as much **`=`**, **as the length** of the said **headline** and print **an empty line** after each message (to understand in detail look at the examples).
99

Content/Chapter-10-methods/exercises-methods/nth-digit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Problem: N-th Digit
22

3-
Create a method **`FindNthDigit(number, index)`**, which takes a number and index N as parameters and prints the N-th digit of the number (counting from right to left and starting from 1). After that print the result on the console.
3+
Create a method **`FindNthDigit(number, index)`**, which takes a number and index N as parameters and prints the N-th digit of the number (counting **from right to left** and starting from 1). After that print the result on the console.
44

55
## Sample Input and Output
66

Content/Chapter-10-methods/exercises-methods/string-repeater.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ Create a method **`RepeatString(str, count)`**, which takes parameters of type *
1010

1111
## Hints and Guidelines
1212

13-
Add to the method below the input string to the result that you will print:
13+
In the method below, inside the loop, append the input string to the result, that you will finally return:
1414

1515
![](/assets/chapter-10-images/21.Repeated-string-01.png)
1616

17-
Keep in mind that in C# concatenating strings in loops leads to bad productivity and is not recommended. Look for more effective solutions here: https://stackoverflow.com/questions/411752.
17+
Keep in mind that **in C# concatenating strings in loops leads to bad performance** and is not recommended. Learn more at: https://docs.microsoft.com/dotnet/api/system.text.stringbuilder#the-string-and-stringbuilder-types.
18+
19+
Look for more effective solutions here: https://stackoverflow.com/questions/411752.
1820

1921
## Testing in the Judge System
2022

0 commit comments

Comments
 (0)