Bug in code coach-finish-my bad | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Bug in code coach-finish-my bad

Hi, im making code coach again and propably have find a bug. In first example, there are 4 wovels in string but Solo solution is ignoring last character- solution works when used for loop(as loop length is length-1) but if you use foreach you get result bigger by one. Any way to contact support to fix this?

4th Jun 2023, 4:54 AM
Drelda
Drelda - avatar
6 Answers
+ 5
There in the task description no vowel y.
4th Jun 2023, 6:33 AM
JaScript
JaScript - avatar
+ 4
Please share the code
4th Jun 2023, 4:59 AM
Sakshi
Sakshi - avatar
+ 4
What you've discovered is actually a bug in the English language, not in sololearn: Y is not a vowel, except when it is. In this case though, the code coach instructions specify which letters you should be searching for, and they do not include y.
4th Jun 2023, 5:15 AM
Orin Cook
Orin Cook - avatar
+ 2
Orin Cook newer though that language can have bug🤣 so my bad, in our language y is normaly vowel so i read count vowels so i counted vowels. Thanks
4th Jun 2023, 5:22 AM
Drelda
Drelda - avatar
0
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Sololearn { class Program { static void Main(string[] args) { string vowels="aeiouy"; string input=Console.ReadLine().ToLower(); int count=0; foreach(char c in input){ if(vowels.Contains(c)){ count++; } } Console.WriteLine(count); } } }
4th Jun 2023, 5:11 AM
Drelda
Drelda - avatar
0
JaScript yup, Orin allready said that. My bad didnt read descriptions more carefully, i leave it here for example for others that we are supposed to read descriptions carefully
4th Jun 2023, 8:17 PM
Drelda
Drelda - avatar