ShinMorita
Posts : 56 Join date : 2010-04-03 Age : 36
| Subject: Who understands this? o.O Mon Apr 19, 2010 12:53 pm | |
| This id programing in C# - Quote :
- using System;
using System.Collections.Generic; using System.Linq; using System.Text;
namespace Calculator { abstract class Calculate { public double _n1, _n2; public abstract double _puta(double _n1, double _n2); } class Add : Calculate { public override double _puta(double _n1, double _n2) { return _n1 + _n2; } } class Sub : Calculate { public override double _puta(double _n1, double _n2) { return _n1 - _n2; } } class Div : Calculate { public override double _puta(double _n1, double _n2) { if (_n2 == 0) { Console.WriteLine("The 2nd number cant be 0"); return 0; } else { return _n1 / _n2; } } } class Mult : Calculate { public override double _puta(double _n1, double _n2) { return _n1 * _n2; } } class Pow : Calculate { public override double _puta(double _n1, double _n2) { return Math.Pow (_n1, _n2); } } class Program { static void Main(string[] args) { Calculate _c1 = null; Console.WriteLine("Do something with your life instead of using this program."); double _nI = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("You're still here?"); char op = Console.ReadLine().ToLower()[0]; switch (op) { case '+': _c1 = new Add(); break; case '-': _c1 = new Sub(); break; case '/': _c1 = new Div(); break; case '*': _c1 = new Mult(); break; case 'P': _c1 = new Pow(); break; default: Console.WriteLine("YOU FAIL MUAHAHAHA >:3"); break; } Console.WriteLine("Dude wtf do something else! D:<"); double _nII = Convert.ToInt32(Console.ReadLine());
_c1._n1 = _nI; _c1._n2 = _nII;
Console.WriteLine("Here is the result: " + _c1._puta(_nI, _nII) + ". Happy now? Dumass"); Console.ReadLine(); } } } If this looks confusing, u havent seen nothing yet >:3 | |
|
Hieru Admin
Posts : 102 Join date : 2010-04-03 Age : 38
| Subject: Re: Who understands this? o.O Mon Apr 19, 2010 4:27 pm | |
| Looks like some sort of "mocking" calculator to me. Never seen a C# code but watching the code I can see it has something to do with numbers and caluculating. And after calculating the program says stuff. Now I don't know if this is standalone program or just a part of a bigger thing? | |
|
YinYang
Posts : 7 Join date : 2010-04-04 Age : 30 Location : Middlesbrough (England)
| Subject: Re: Who understands this? o.O Mon Apr 19, 2010 5:40 pm | |
| something calculater due to this add sub mult div and whats pow? xD | |
|
Sponsored content
| Subject: Re: Who understands this? o.O | |
| |
|