C# object simple console program
Page 1 of 1
KillerCrocker




Posts: 20501

PostPosted: Sun, 4th Dec 2011 18:30    Post subject: C# object simple console program
hi guys. Maybe someone here have or know where to look for program code in C# object programming (visual studio)

I have to make simple CONSOLE program using object programming in C#.

Something like Calculator which writes resoults to file would be enough I think.
or maybe something like menu(aka visual novel game) where I choose one of 3 options and then have option to save that text in file or sth.
There should be sharing through classes and stuff involved. maybe even polymorphism...

ive searched google but there are only ui applications harder than one I have to do.


3080 | ps5 pro

Sin317-"im 31 years old and still surprised at how much shit comes out of my ass actually ..."
SteamDRM-"Call of Duty is the symbol of the true perfection in every aspect. Call of Duty games are like Mozart's/Beethoven's symphonies"
deadpoetic-"are you new to the cyberspace?"
Back to top
garus
VIP Member



Posts: 34200

PostPosted: Sun, 4th Dec 2011 18:32    Post subject:
snip


Last edited by garus on Tue, 27th Aug 2024 21:31; edited 1 time in total
Back to top
KillerCrocker




Posts: 20501

PostPosted: Sun, 4th Dec 2011 18:41    Post subject:
yeah I know. I just have a short deadline and I could really use something ready. Still I will have to study it becouse I need to know how to explain all functions used

besides. I HATE programming and this C# object-oriented programming is only attached to my studies becouse it have to be there. I never intended to be a programmer but still I have to finish even those lessons which I am uninterested in in my studies.


3080 | ps5 pro

Sin317-"im 31 years old and still surprised at how much shit comes out of my ass actually ..."
SteamDRM-"Call of Duty is the symbol of the true perfection in every aspect. Call of Duty games are like Mozart's/Beethoven's symphonies"
deadpoetic-"are you new to the cyberspace?"
Back to top
me7




Posts: 3942

PostPosted: Sun, 4th Dec 2011 18:54    Post subject:
Join the club. Almost every study has some interdisciplinary lectures attached to it to broaden your horizon. Looking back, I'm happy that I was forced out of my comfort-zone during my studies several times to look at familiar subjects from a different perspective.
I'm with garus on this one. I'll gladly help you out if you're stuck, but if even you don't care about your own studies - why should I?
Back to top
LeoNatan
☢ NFOHump Despot ☢



Posts: 73196
Location: Ramat Gan, Israel 🇮🇱
PostPosted: Sun, 4th Dec 2011 18:54    Post subject:
I think you might need to create a GUI interface using Visual Basic .NET (assembly compatible to C#) to track the IP address.


My IMDb Ratings | Fix NFOHump Cookies | Hide Users / Threads | Embedded Content (Videos/GIFs/Twitter/Reddit) | The Derps Collection

Death smiles at us all; all we can do is smile back.


Last edited by LeoNatan on Sun, 4th Dec 2011 19:03; edited 1 time in total
Back to top
garus
VIP Member



Posts: 34200

PostPosted: Sun, 4th Dec 2011 19:03    Post subject:
snip


Last edited by garus on Tue, 27th Aug 2024 21:31; edited 1 time in total
Back to top
KillerCrocker




Posts: 20501

PostPosted: Sun, 4th Dec 2011 19:16    Post subject:
Thanks garus but thats not helpfull unfortunetly.

I dont get it why do You people make it such a philosophy? ive said that I hate programming and its just there for the sake of it.
I dont like it thats all. Would You like mathematics on art studies? it feels like that to me. I am on economist studies combined with network cisco routers programming (which I understand and ive even already worked as computer support+ network setting and cisco setup.

Its not like every god damn IT specialist have to know programming. I love IT but bever felt myself for programming. God damnit.

Those are my second studies. Ive failed my first one on first semester. But here I am on my another studies which are very important to me and its my 5th semesters out of 6. And I didnt had any problems at all on semesters before.

anyway. I have good 250 pages C# programming guide and will try again my luck with it Laughing


3080 | ps5 pro

Sin317-"im 31 years old and still surprised at how much shit comes out of my ass actually ..."
SteamDRM-"Call of Duty is the symbol of the true perfection in every aspect. Call of Duty games are like Mozart's/Beethoven's symphonies"
deadpoetic-"are you new to the cyberspace?"
Back to top
garus
VIP Member



Posts: 34200

PostPosted: Sun, 4th Dec 2011 19:34    Post subject:
snip


Last edited by garus on Tue, 27th Aug 2024 21:31; edited 1 time in total
Back to top
KillerCrocker




Posts: 20501

PostPosted: Sun, 4th Dec 2011 19:37    Post subject:
Yes I see that Laughing but I dont understand what this program is about. It just gives me binary codes And thats not what I am looking for


3080 | ps5 pro

Sin317-"im 31 years old and still surprised at how much shit comes out of my ass actually ..."
SteamDRM-"Call of Duty is the symbol of the true perfection in every aspect. Call of Duty games are like Mozart's/Beethoven's symphonies"
deadpoetic-"are you new to the cyberspace?"
Back to top
KillerCrocker




Posts: 20501

PostPosted: Sun, 4th Dec 2011 20:08    Post subject:
Actually I might use one of applications which Ive writed for other lesson(Web programming)

Would application which have 2 classes such as client and server, where server is put into "listening state" waiting for client to start(manually) and then reports that client have connected and displays on which address and port.


hmmm... I think there isnt enough of object programming in this one. Any ideas what function I could add to make it object-oriented? Maybe a way to create log.txt which holds lists of ALL connections?


3080 | ps5 pro

Sin317-"im 31 years old and still surprised at how much shit comes out of my ass actually ..."
SteamDRM-"Call of Duty is the symbol of the true perfection in every aspect. Call of Duty games are like Mozart's/Beethoven's symphonies"
deadpoetic-"are you new to the cyberspace?"
Back to top
Areius




Posts: 14853

PostPosted: Sun, 4th Dec 2011 23:35    Post subject:
Very simple example I created for you out of my head (didn't test for compile, but SHOULD work):

Code:

public abstract class Part
{
public abstract void Run();
}

public class Car
{
public List<Part> parts = new List<Part>();

public Car()
{
_parts.Add(new Horn());
_parts.Add(new Wheel());
}
public void Run()
{
foreach (Part part in _parts)
part.Run();
}
}

public class Horn : Part
{
public override void Run()
{
Console.WriteLine("BEEEEEEEEEEEEEEB");
}
}

public class Wheel : Part
{
public override void Run()
{
Random rand = new Random();
if (rand.Next(0,10) < 5(
Console.WriteLine("Cannot rotate, flat tire");
else
Console.WriteLine("I'm spinning around...");
}
}


And in your main do something like:

Car car = new Car();
car.Run();

And it should print out some stuff. Make it more interesting though as this is very basic but it should get you some idea on how to start Smile BTW, it's not very hard, just build in some logic Wink
Back to top
KillerCrocker




Posts: 20501

PostPosted: Mon, 5th Dec 2011 01:25    Post subject:
Nice, great thanks ! Smile

So there are objects and different classes which correspond to each other.Thats one of thing I need. It might be a bit to simple becouse even I understand it Laughing but I think I will try to expand on it further.
Its late night here so Ive only created those classes and did used Your code. besides little autocorrect stuff,there is "The name '_parts' does not exist in the current context" warning, which I am unsure yet what do do about.

btw. On the classes we are doing polymorphism, constructors, inheritance(?) and basicly we make use of Using.System... libraries lately.
Also it wouldnt be a bad idea if all the dialogue options would write into log.txt file in the order Laughing

Thanks again. now I have go to sleep and I will have to expand on it tomorrow somehow, becouse deadline is day after


3080 | ps5 pro

Sin317-"im 31 years old and still surprised at how much shit comes out of my ass actually ..."
SteamDRM-"Call of Duty is the symbol of the true perfection in every aspect. Call of Duty games are like Mozart's/Beethoven's symphonies"
deadpoetic-"are you new to the cyberspace?"
Back to top
Frant
King's Bounty



Posts: 24636
Location: Your Mom
PostPosted: Mon, 5th Dec 2011 03:39    Post subject:
Lol, they expect you to create a program without knowing how to develop?


Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!

"The sky was the color of a TV tuned to a dead station" - Neuromancer
Back to top
KillerCrocker




Posts: 20501

PostPosted: Mon, 5th Dec 2011 11:41    Post subject:
Laughing Its not like We have a teacher. The fucker just sits behind the desk for whole class time and then only tells us we have to do stuff like this on our own and points at his not soo good guide.
He proboably behave like this becouse this isnt our main course..

He basicly doesnt care. He says that some people cant play on piano and some people cant program. Either way, Everyone have to make this (better or worse that it)

Yes, Its not that hard, to start with. I just cant find myslef interested enough to learn more than maybe hour at a time.


3080 | ps5 pro

Sin317-"im 31 years old and still surprised at how much shit comes out of my ass actually ..."
SteamDRM-"Call of Duty is the symbol of the true perfection in every aspect. Call of Duty games are like Mozart's/Beethoven's symphonies"
deadpoetic-"are you new to the cyberspace?"
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - The Useless Void
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group