j7nooah
j7nooah
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
is this right?
38 replies
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
using System; using System.Reflection; public class Program { static void Main(string[] args) { Console.WriteLine("Bitte geben sie Wort-Wort-Zahl ein"); string nutzereingabe = Console.ReadLine();
int posbindestrich1 = nutzereingabe.IndexOf("-"); int posbindestrich2 = nutzereingabe.IndexOf("-",posbindestrich1 + 1); Console.WriteLine(posbindestrich1); Console.WriteLine(posbindestrich2); string wort1 = nutzereingabe.Substring(0, posbindestrich1); string wort2 = nutzereingabe.Substring(posbindestrich1 + 1, posbindestrich2 - posbindestrich1 - 1); string wort3 = nutzereingabe.Substring(posbindestrich2 + 1); Console.WriteLine("Das erste Wort ist:" + wort1); Console.WriteLine("Das zweite Wort ist:" + wort2); Console.WriteLine("Das dritte Wort ist:" + wort3); Console.WriteLine(wort1); Console.WriteLine(wort2); Console.WriteLine(wort3); int überprüfung1 = 0; int überprüfung2 = 0; int überprüfung3 = 0; if(!int.TryParse(wort1, out überprüfung1 ) && !int.TryParse(wort2,out überprüfung2) && int.TryParse(wort3, out überprüfung3)) { Console.WriteLine("Eingabe ist richtig"); } else { Console.WriteLine("Eingabe ist nicht richtig"); } } }
38 replies
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
string functions, if function, loop. convert
38 replies
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
i still dont know how to do it
38 replies
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
I can understand what you mean, because when programming everything is in English, but for us the teacher doesn't care and we can choose for ourselves whether English or German, since I'm still a beginner it's easier for me with German
38 replies
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
I should be able to do the part with string functions easly,but the difficult part for me is the part with if where I have to check whether the word-word-number format is correct. I know how it works but I can't practically implement it in C#
38 replies
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
i dont know how i can check the whole format part like word-word-nummber i dont know how to check that with if
38 replies
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
in the assignsment is that we are not allowed to use the split method because i have not leanred that and we should use the string methods instead
38 replies
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
how can i chceck word-word-number that it matches the format
38 replies
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
idk if you can understand this bc its german
38 replies
CC#
Created by j7nooah on 11/15/2023 in #help
I am new to c# and need help
using System; public class Program { static void Main(string[] args) { Console.WriteLine("Bitte geben sie bitte ein Wort-Wort-Zahl ein"); string nutzereingabe1 = Console.ReadLine(); string nutzereingabe2 = Console.ReadLine(); string nutzereingabe3 = Console.ReadLine(); string nutzereingabezusammen = nutzereingabe1 + "-" + nutzereingabe2 + "-" + nutzereingabe3; Console.WriteLine(nutzereingabezusammen); int integerumwandlung = 0; if (!Int32.TryParse(nutzereingabe1, out integerumwandlung) && (!Int32.TryParse(nutzereingabe2, out integerumwandlung) && (Int32.TryParse(nutzereingabe3, out integerumwandlung)))) {
} else { Console.WriteLine("errror"); } } }
38 replies