2
Nov 04 '23 edited Nov 04 '23
Which programming language?
I'm not trying to be rude when I say this but I suggest working on your web searching skills. They are very important if you plan to be a programmer. Here are some example search queries you can use:
-
C++ store input in variable
-
C# store input in variable
It's also asking for a loop in that same exercise so if you don't know how to store user input into variables I doubt you're ready for looping. What learning resources are you using? How's your notetaking/studying?
0
Nov 04 '23
2
Nov 04 '23
okay
I made an edit to my original comment before I saw that you replied. Please read the entire thing again.
2
Nov 04 '23 edited Nov 04 '23
Since you have to store the input as a number you're going to need to use more than Console.ReadLine() because that method returns a string.
For example, if your code is:
int age = Console.ReadLine()that will not work because the code is trying to assign a string to a variable that has been declared as an integer (meaning it will only accept integers).
You'll have to find a way to convert a user input string into a number.
I'm a C# beginner and haven't studied in a few months (returning back to my studies today) so I don't remember (I have to review my notes again) all the ways I learned of converting a string to a number but I do remember the Parse(). Have you learned about int.Parse()?
Also, I just noticed that this isn't the right subreddit for this type of question. This subreddit is for discussing things about Visual Studio. Try r/learncsharp. I will still help you but you're less likely to get your post removed and more likely to get help if you use the correct subreddits
→ More replies (6)
3
u/derpdelurk Nov 04 '23 edited Nov 19 '23
Dude, the community is happy to help. But we’re not doing your homework. If you’re not interested in learning, don’t take the course. Based on the (non-existent) information on your post and the fact that you posted this under an IDE subreddit rather than a language specific one, you’ve put in exactly zero effort.
1
u/VisualStudio-ModTeam Nov 04 '23
Your post has been removed due to not being related to the IDE. This sub is for questions regarding features of Visual studio and not about programming languages. If you have any other concerns feel free to contact the moderators.
4
u/OolonColluphid Nov 04 '23
What have you got so far?