Uitdaging: Tekenreeksopmaak
Corrigeer de code zodat de waarden correct worden opgenomen in de output-string.
main.cs
12345678910111213141516using System; internal class Program { static void Main(string[] args) { int num_1 = 10; int num_2 = num_1 * 2; int num_3 = num_2 * 3; int num_4 = num_1 + num_2 + num_3; // Change code below this line Console.WriteLine("The sum of {num_1}, {num_2} and {num_3} is {num_4}"); // Change code above this line } }
Zoek naar ontbrekende symbolen in de syntaxis voor stringopmaak.
main.cs
1234567891011121314151617using System; internal class Program { static void Main(string[] args) { int num_1 = 10; int num_2 = num_1 * 2; int num_3 = num_2 * 3; int num_4 = num_1 + num_2 + num_3; // Change code below this line Console.WriteLine($"The sum of {num_1}, {num_2} and {num_3} is {num_4}"); // Change code above this line } }
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 2. Hoofdstuk 9
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Suggested prompts:
What is the current code that needs to be fixed?
Can you show me the part of the code where the string formatting is used?
What programming language is this code written in?
Awesome!
Completion rate improved to 1.59
Uitdaging: Tekenreeksopmaak
Veeg om het menu te tonen
Corrigeer de code zodat de waarden correct worden opgenomen in de output-string.
main.cs
12345678910111213141516using System; internal class Program { static void Main(string[] args) { int num_1 = 10; int num_2 = num_1 * 2; int num_3 = num_2 * 3; int num_4 = num_1 + num_2 + num_3; // Change code below this line Console.WriteLine("The sum of {num_1}, {num_2} and {num_3} is {num_4}"); // Change code above this line } }
Zoek naar ontbrekende symbolen in de syntaxis voor stringopmaak.
main.cs
1234567891011121314151617using System; internal class Program { static void Main(string[] args) { int num_1 = 10; int num_2 = num_1 * 2; int num_3 = num_2 * 3; int num_4 = num_1 + num_2 + num_3; // Change code below this line Console.WriteLine($"The sum of {num_1}, {num_2} and {num_3} is {num_4}"); // Change code above this line } }
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 2. Hoofdstuk 9