Question Moving point

Daniel_04

New member
Joined
Nov 14, 2021
Messages
4
Programming Experience
Beginner
I've been thinking about this task for 5 days and I can't solve it, can you help me?

Create a point class with the fields x and y field-static counter.
Create a ToTheRight method that increments x by 1 on each call.
Create a ToTheLeft method that reduces x by 1 on each call.

Create 3 instances.
Call the methods for each instance 2-3 times.
display how many movements the points have made.
 
Sure we can help, but it's not for us to just do it for you. You need to explain what your thinking is and where you're stuck. Start at the beginning:
Create a point class
Do you know how to declare a class or not? If so, do it and show us that you've done it. If not, you should be looking back at whatever material you have - text book or notes - to learn how to do that. If you still can't for some reason, you need to actually ask the question you need answered: how do I declare a class. When you ask for help here, you need to be specific. Showing us an assignment that includes at least six different tasks and saying "help" is not showing any effort on your part. You need to start with the first of the six tasks, do as much as you can for yourself first and then ask a specific question you need help with. Once that's done, you then need to do as much as you can on the remaining steps and then ask another specific question in a new thread if and when you encounter another problem. If you have absolutely no idea how to do any of that then I can only assume that you have simply ignored any material you have and not really tried at all. yes, we can help, but help implies that you are doing your part too. Please show us that that's the case and you'll find that help is at hand.
 
I am beginner, and I just don't know from where to start. I am python developer, but c# is very hard to me, but I must to know it, because we study it in school.
 
Talk to your teacher. Tell them you need extra assistance because you don't understand.
 
Also, Python has classes in the language. How would you do this in Python? What is keeping you from doing this in C#?
 
Last edited:
If you are studying it in school then you have already been given all the information. That doesn't mean that you can necessarily do it all and it doesn't mean that no one here will help but, again, it's not for us to just do your homework for you. If you're going to get the marks then you need to do the work. We can help but you have to give us something to work with. As it stands, we can't see any effort on your part and, for all we know, you haven't made any. Are you really saying that you were never shown how to declare a class in your schoolwork? If not, what have you been shown? If so, what's stopping you doing what you were shown? Giver us something to help with. If you're just going to say "I don't know, you do it" then I'm afraid you'll be disappointed.
 
Personally, this is a relatively easy assignment. The only tricky part is the requirement to use all static fields. This will make things behave unexpectedly depending on the order of instantiation and operations, unless there is a typo in the instructions where the counter field is the only one that is supposed to be static, but x and y are not.
 
Last edited:
Tell the dean of your college that your teacher told you that he can't help you. You'll find things will suddenly get escalated in wild and unexpected ways.
 
Anyway, show us how you would do this in Python. How would you switch things over to C#?
 

Latest posts

Back
Top Bottom