+ 1

Can somebody help

Help with a code project pls

6th Apr 2024, 10:11 AM
Lennart Lang
Lennart Lang - avatar
29 Réponses
+ 4
What is the task? What help do you need? What have you tried?
6th Apr 2024, 10:14 AM
Lisa
Lisa - avatar
+ 4
Lennart Lang , this not a chat app. you have posted (additional) 11 not meaningful comments, which makes the thread difficult to read. please also include your attempt here, so that we can see what your issue exactly is.
7th Apr 2024, 6:04 AM
Lothar
Lothar - avatar
+ 3
start with a loop over the string array.
6th Apr 2024, 4:19 PM
Lisa
Lisa - avatar
+ 2
i would use a for loop. from 0 up to words.Length
6th Apr 2024, 4:24 PM
Lisa
Lisa - avatar
+ 1
iterate over words. for each word, check if string contains the substring (input). output as instructed.
6th Apr 2024, 4:14 PM
Lisa
Lisa - avatar
+ 1
then you should review the previous lesson contents before you do the task, right?
6th Apr 2024, 4:17 PM
Lisa
Lisa - avatar
+ 1
Ok?
6th Apr 2024, 4:21 PM
Lennart Lang
Lennart Lang - avatar
+ 1
For or while?
6th Apr 2024, 4:21 PM
Lennart Lang
Lennart Lang - avatar
+ 1
For, right?
6th Apr 2024, 4:21 PM
Lennart Lang
Lennart Lang - avatar
+ 1
Ok
6th Apr 2024, 6:48 PM
Lennart Lang
Lennart Lang - avatar
+ 1
did you start with the for-loop? link your code.
7th Apr 2024, 6:48 AM
Lisa
Lisa - avatar
+ 1
i asked you yesterday to start with a for-loop. Link your code.
7th Apr 2024, 7:07 AM
Lisa
Lisa - avatar
+ 1
inside the loop, get the word of the current iteration: word[count]. use an if-statement, to check if the current word contains the "letter". I would use the Contains() method of strings. https://learn.microsoft.com/en-us/dotnet/api/system.string.contains?view=net-8.0 if the current word contains the letter, output as instructed.
7th Apr 2024, 6:13 PM
Lisa
Lisa - avatar
0
using System; using System.Collections.Generic; namespace Code_Coach_Challenge { class Program { static void Main(string[] args) { string[] words = { "home", "programming", "victory", "C#", "football", "sport", "book", "learn", "dream", "fun" }; string letter = Console.ReadLine(); int count = 0; //your code goes here } } }
6th Apr 2024, 10:11 AM
Lennart Lang
Lennart Lang - avatar
0
I have tried nothing bc I don't understand it
6th Apr 2024, 4:03 PM
Lennart Lang
Lennart Lang - avatar
0
And I need to make it like the I input a Letter the program outputs every word with this letter
6th Apr 2024, 4:04 PM
Lennart Lang
Lennart Lang - avatar
0
Or many letters as input
6th Apr 2024, 4:04 PM
Lennart Lang
Lennart Lang - avatar
0
But I didn't really understand how to do it
6th Apr 2024, 4:04 PM
Lennart Lang
Lennart Lang - avatar
0
Idk how
6th Apr 2024, 4:15 PM
Lennart Lang
Lennart Lang - avatar
0
I didn't understand what I "learned"
6th Apr 2024, 4:15 PM
Lennart Lang
Lennart Lang - avatar