noob needs help with C#

dr.grimm

Well-Known Member
Joined
Jun 1, 2008
Messages
301
Reaction score
2
Location
Durbanville
hi there,

i was hoping anyone out there can help me with a project for college.. i am currently studying C# but the practical exercises is killing me and my book is not much of a guide ...

i have to write 2 programs... one being a program to out put a sequence of the numbers to the console, the user must provide the starting number and indicate whether the sequence should be ascending or descending. included a class in the program that writes the sequence to the screen. i have to use delegates (what ever that is ...my book is sooo wage on that) to point to the relevant method that either adds or subtracts from the starting number to obtain the next number in the sequence

then i have to do a program that uses a multicast delegate. this delegate must preform two operations by invoking other delegates. first a multiplication then division. output of each operation must be written to the console.

if anyone can mybe give me some pointer on how to begin this i would appreciate it so must...

:confused::confused::confused:
 
Try reading the MSDN a bit - there's a wealth of information that's very detailed and easy to follow.
 
Here, let me Google that for you.

The first 4 (particularly the csharpcorner articles) should have you well on your way to the solution. Failing that, the next 6 at least should help.

With respect, you seem to have come expecting us to provide you with code - that's not going to happen. We(I) will happily help you through code that you have created, and are having trouble with, but I won't give you the code. No way you're going to learn that way. Similarly, if you are having trouble understanding the concepts, we may be able to help. We're not going to teach you though. We don't get paid enough. Or at all, come to think of it. ;)
 
to anyone reading this thread ... i am not expecting ANYONE (Raithlin) to write the code for me...if someone can maybe just help me understand the question better...

i do have the first part.. where i ask the user to enter to enter a number, but the thing i am struggling with is understanding the use of delegates
 
to anyone reading this thread ... i am not expecting ANYONE (Raithlin) to write the code for me...if someone can maybe just help me understand the question better...

i do have the first part.. where i ask the user to enter to enter a number, but the thing i am struggling with is understanding the use of delegates

show meh teh codez isn't going to get you much help, maybe if you post a specific question (along with what you've tried) you'll get better answers.
 
to anyone reading this thread ... i am not expecting ANYONE (Raithlin) to write the code for me...if someone can maybe just help me understand the question better...
Apologies then. That was my rant for the week. :erm:
i do have the first part.. where i ask the user to enter to enter a number, but the thing i am struggling with is understanding the use of delegates

A Delegate is (simplified) a method pointer that declares the expected inputs and outputs - so in the case of a calculator, you'd expect something like
Code:
internal delegate double Calculate(double, double);

[EDIT]
I had done a whole example, but found a link that does it better than I could.

Funny enough, I found this link while searching for c# calculators using delegates. My original statement stands - you need to learn how to use Google better. :)
[/EDIT]
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X