+ 2
Words in Intermediate C#
The program you are given defines an array with 10 words and takes a letter as input. Write a program to iterate through the array and output words containing the taken letter. If there's no such word, the program should output, "No match". Sample Input I Sample Output fun Note and for your information to the Words problem solution: Recall the Contains() method. Code is below or on a separate page due to truncation.
25 Réponses
+ 2
There is no code. Show your code. Describe the issue that you are facing.
+ 2
Don't paste it in a comment.
Copy the code in a code bit on playground. Save.
Come back to this thread. Click +, Insert Code, sort for My Code Bits, select your code.
+ 1
Can you link the code now?
+ 1
Are you on Android?
Click on the text, keep pressed. A menu should open.
+ 1
Take the time you need.
Try to put it in a script.
We can still fix it tomorrow or so. 👍
+ 1
Michael
You can refer to this link and learn how to post a code in Q&A.
https://sololearn.com/compiler-playground/Wek0V1MyIR2r/?ref=app
At a glance, it seems there are duplicated code at the beginning. Maybe it was a copy & paste error?
And I also see you are mixing python syntax in the code, such as:
foreach string letter in words:, also ;
elif:
+ 1
Michael
If you have access to a pc, you can create your code on the web version. So that you can type your code while viewing the code you posted.
Once you created the code, follow the instructions and post it here.
0
How many times have you found anything unconditional go wrong with this app?
0
My post hasn't appeared on my account as of yet. Thank you for bearing with me.
0
No
0
At the moment and after the instructions truncated my code, I'm not able to copy and paste it to put it to this forum.
0
Here's an altered, plain text copy of my code in the comment text box in which will follow.
0
My phone deleted it. The code will follow TBA
0
There's no save, there's no select all, there's no cut, there's no paste, there's no copy, and there's no link to place anywhere in this app. Sounds like clerical items like cut, paste, and copy, perhaps more, isn't working on devices with an operating system. I'm saying all devices with an operating system, too.
0
The code is TBA or to be announced. Thank you for your patience.
0
Just like Android and iOS, 33% of the time it works. This code is lengthy and it looks like it exceeds my clipboard or character limit.
0
I'll try again even if I have to piece it together.
0
using System;
using System.Collections.Generic;
namespace Code_Coach_Challenge
{
class Program
{
static void Main(string[] args)
{
string[] words = {
"home",
"programming",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
foreach string letter in words:
if(contains(words[count]): {
Console.WriteLine(words[count]);
count = count + 1;
}
elif:
0
Console.WriteLine("No match");
count = count + 1;
}
}
}
}
0
The last portion of code is the following:
elif: {
Console.WriteLine("No match");
count = count + 1;
}
}
}
}
}