Win a copy of FM24 in our Prediction League. Prizes are given out to the best predictor each month, so you have multiple chances to win.
sortitoutsi
Football Manager Graphics
- FM24 Graphics
- FM24 Player Faces
- FM24 Logos
- FM24 Kits
- FM24 Backgrounds
- FM24 Installation Instructions
Football Manager Guides Database
Football Manager Data Update
Football Manager Shortlists
- FM24 Guides
- FM24 Shortlists
- Best FM24 Wonderkids
- Cheap FM24 Wonderkids
- FM24 Young Players aged 21-25
- FM24 Best Free Players
- FM24 Expiring Contracts
- FM24 Bargain Players
- FM24 Injury Prone Players
- FM24 Richest Clubs
- Best FM24 Facilities
- FM23 Guides
- FM23 Shortlists
- Best FM23 Wonderkids
- Cheap FM23 Wonderkids
- FM23 Young Players aged 21-25
- FM23 Best Free Players
- FM23 Expiring Contracts
- FM23 Bargain Players
- FM23 Injury Prone Players
- FM23 Richest Clubs
- Best FM23 Facilities
This site is not endorsed by Sports Interactive or SEGA and is intended for entertainment purposes only. The views expressed on this site are the views of the individual contributors and not those of Sports Interactive or SEGA.
chokosc
For our first project we need to think of a problem and solve it. I decided to go as close as possible to what we did in class. What we did in class is take a word, change it's first letter to a capital letter and then put the capital letter back. The problem is that it was only the first letter and not the rest of the word.
So I decided to try and get the whole word in and this is what I got so far:
start:
Console.WriteLine("Please enter a word below:"
Console.WriteLine(""
string str = Console.ReadLine();
char char1;
if (str[0] >= 97)
{
char1 = (char)(str[0] - 32);
}
else
{
char1 = (char)(str[0] + 32);
}
char char2 = (char)(str[1]);
char char3 = (char)(str[2]);
char char4 = (char)(str[3]);
char char5 = (char)(str[4]);
Console.WriteLine(""
Console.Write(char1);
Console.Write(char2);
Console.Write(char3);
Console.Write(char4);
Console.WriteLine(char5);
goto start;
The problem with that is that it has to be a 5 letter word. if it is lower than that, it just gives me an error and if it is more than that it doesn't finish the word.
So my question is: is there a way to use if and tell it how many chars we need, depending on how many letters there are? So basically:
if amount of letters = 2
char char2 = (char)(str[1]);
if amount of letters = 3
char char2 = (char)(str[1]);
char char3 = (char)(str[2]);
and so on.
Thanks for any help!
Phoenix Arrow
You'd need to make char2, char3, char4 etc an array though. Then make a loop which goes as long as char.length - 1.
chokosc
chokosc
What do you mean?
Phoenix Arrow
chokosc
I found this website that explains arrays but I am not sure which to use and how.
http://msdn.microsoft.com/en-us/library/aa288453(v=vs.71).aspx
Phoenix Arrow
I think that's about write. But I haven't done any programing since May and that was web stuff. I haven't done any C++ since Jan 2011 and I haven't done any C# since a year before that because I do more IT support now than programming so I'm really rusty and was bad at it to begin with. I also don't really know what you've done before or what you're meant to be using. If you're stuck, talk to your lecturer. If you're stuck and you don't want to ask your lecturer, try asking on stackoverflow.com. Make sure you make it clear you're a beginner though or you might get a bunch of shit back which makes no sense.
chokosc
in the Console.WriteLine?
chokosc
Phoenix Arrow
Phoenix Arrow
chokosc
Telegram Sam
Phoenix Arrow
Telegram Sam
Go right ahead.
Deano
chokosc
Sad to hear that! Have the next 3 years to study this
Phoenix Arrow
It is fun though, it's just not a doss subject.
chokosc
Someone on the website you showed me wrote down a working code. It is full of things that I don't know yet so I'll just ask my teacher what to do. Maybe he'll tell me it is enough (what I have already done) seeing as how we haven't really learnt much.
Slashman X
Programming is class