C
C#

YO I NEED HELP writing a code need advice not for u to write it for me

YO I NEED HELP writing a code need advice not for u to write it for me

RRANI11/20/2023
write me a c# program that get 3 latters and tell if they are by the order like abc if they are backward like cba or if they are random like ami help mb worng quition i need a c# program that get 3 latters and tell if they are by the order like abc if they are backward like cba or if they are random like ami
BBuddy11/20/2023
We won't write it for you $details
MMODiX11/20/2023
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, and what you expect the result to be. Upload code here https://paste.mod.gg/ (see $code for more information on how to paste your code)
BBuddy11/20/2023
Specifically in this case, please post your code.
RRANI11/20/2023
i need how to like do the letter shit i know the rest
ZZacharyPatten11/20/2023
1. What does "get 3 letters mean"? Allow the user to input 3 letters in the console? Randomly Generate 3 letters? etc. 2. Are there only 3 possible outputs? in-order, reverse-order, no-order?
RRANI11/20/2023
like u get abc and program need to say u get 3 letter and that the only 3 outpot
ZZacharyPatten11/20/2023
how do you get three letters? do you already have that code written? are you doing Console.ReadLine() to get the letters? can you share your code
RRANI11/20/2023
in put are 3 letters output in-order, reverse-order, no-order
ZZacharyPatten11/20/2023
can you share your current code? that will be the easiest way for us to help $codegif
RRANI11/20/2023
using System; class Program { static void Main() { //need to get letter and do the order part if (first < second && second < third) { Console.WriteLine("The letters are in ascending order (like abc)."); } else if (first > second && second > third) { Console.WriteLine("The letters are in descending order (like cba)."); } else { Console.WriteLine("The letters are in random order."); } } else { Console.WriteLine("Invalid input. Please enter exactly three letters."); } } }
ZZacharyPatten11/20/2023
you should start with the //need to get letter and do the order part it will be easier to test the rest of your code if you do that first is that what you are asking for help on? because your logic of your if statements looks like you are on the right track at first glance šŸ™‚
RRANI11/20/2023
Console.Write("numer 1:"); int num3 = int.Parse(Console.ReadLine()); Console.Write(numer 2"); int num2 = int.Parse(Console.ReadLine()); Console.Write("number 3"); int num1= int.Parse(Console.ReadLine()); to get number and how to do the output how to like do the order shit?
ZZacharyPatten11/20/2023
you don't necessarily need to do the int.Parse you do that if you need to convert he value into an integer you don't sound like you need to do that for your code
RRANI11/20/2023
that like to get the number how to do the order
ZZacharyPatten11/20/2023
you are so close that I'll give you this possible example
Console.Write("Provide 3 characters: ");
string input = Console.ReadLine() ?? "";
input = input.Trim();
if (input.Length != 3)
{
Console.WriteLine("Invalid Input.");
return;
}
char first = input[0];
char second = input[1];
char third = input[2];

Console.WriteLine($"You provided chars '{first}', '{second}', and '{third}'");
Console.Write("Provide 3 characters: ");
string input = Console.ReadLine() ?? "";
input = input.Trim();
if (input.Length != 3)
{
Console.WriteLine("Invalid Input.");
return;
}
char first = input[0];
char second = input[1];
char third = input[2];

Console.WriteLine($"You provided chars '{first}', '{second}', and '{third}'");
that example jsut has the user provide all 3 characters in one Console.ReadLine and it splits the characters into seperate variables from the input string you can get individual chars from a string using the indexer. myString[...] where ... is the index of the char to get from the string input.Trim() is a helper method that will remove white space on the front and end of the string, so if the user inputs " abc " instead of just "abc" the code will still allow it you don't necessarily need to include the .Trim() if you don't want to. it is just generally a good practice

Looking for more? Join the community!

C
C#

YO I NEED HELP writing a code need advice not for u to write it for me

Join Server
Want results from more Discord servers?
Add your server
Recommended Posts
Blazor ServicesI dont know too much blazor, but I have a .cs file in a /Settings folder, in which I would like to aHow to optimize this?I have following: ```cs using System; namespace SquareCalculus { internal class FigureTriangle In VSCode, SDK not Recognized on ChromeOSHi. I just installed the .NET SDK and the Runtime by following the instructions for Ubuntu on the MiNito.AsyncEx vs DotNext.ThreadingWe're currently searching for a nice AsyncAutoResetEvent implementation. We found two suitable impleSequential BlinkersHello everyone! I bought these sequential blinkers that run off an stm32 blue pill board. the only pTrying to use Microsoft.Kiota namespace but not found when importingI am trying to use this method from the Microsoft.Kiota.Abstractions.Extensions namespace: ToFirstChWinUI3 Scheduler CalendarViewhello im trying to make a winui3 calendarview interactive calendar where I can predefine dates in myThe call is ambiguous between the following methods or properties: 'Thread.Thread(ThreadStart)' andi have to upload by filesHelp a noobie out with a simple hangmanHi! New to coding and I need some help to solve this problem. Shall I save the words to a list? AnyC# Image Resizing on Visual Studio CodeI've tried both ``newPic.SizeMode = PictureBoxSizeMode.StretchImage;`` and ``newPic.SizeMode = PictuI'm stuck,visual studio 22, I need help making my invaders/enemies move left to right then downIā€™m trying to get my invaders/enemies to move left to right then down like in the game space invaderāœ… Where should I store all the sensitive file on .NET project?Hello everyone, May I know where should I store all the credential files that needs to be used by .Unity CodeI have been trying to get my C# code to work in unity for about a week and I am officially lost. I'vHelp! Reporting service in dotnet Core?please don't mind my english, it is not that good. i have created 2 projects one is server -dotnetCatAPI Json deserialization issue.I'm having trouble getting my code to deserialize my json correctly. When I run my Program.cs I get āœ… Any idea why I cant use sendkey?Authorization in microservices archHello everyone, I'm quite new to the NET microservices arhitecture and right now I'm implementing a.āœ… I can't get my runButton button to work on a windows form app```cs if (e.KeyCode == Keys.Enter || (e.Modifiers == Keys.None && sender == runButton)) ``` I can sGit and Google Drivenew git user.. it seems to have your local repositories in a google drive controlled file structure ASP.NET CRUD MODALI created a MVC controller with actions (CRUD) and I would like to know, how to modify this pre gene