GaoGao
Would you like to react to this message? Create an account in a few clicks or log in to continue.

GaoGao

Gaming community
 
HomePortalLatest imagesSearchRegisterLog in

 

 Who understands this? o.O

Go down 
3 posters
AuthorMessage
ShinMorita

ShinMorita


Posts : 56
Join date : 2010-04-03
Age : 36

Who understands this? o.O Empty
PostSubject: Who understands this? o.O   Who understands this? o.O I_icon_minitimeMon 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
Back to top Go down
Hieru
Admin
Hieru


Posts : 102
Join date : 2010-04-03
Age : 38

Who understands this? o.O Empty
PostSubject: Re: Who understands this? o.O   Who understands this? o.O I_icon_minitimeMon 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?
Back to top Go down
https://gaogao.forumotion.com
YinYang

YinYang


Posts : 7
Join date : 2010-04-04
Age : 30
Location : Middlesbrough (England)

Who understands this? o.O Empty
PostSubject: Re: Who understands this? o.O   Who understands this? o.O I_icon_minitimeMon Apr 19, 2010 5:40 pm

something calculater due to this
add
sub
mult
div
and whats pow?
xD
Back to top Go down
Sponsored content





Who understands this? o.O Empty
PostSubject: Re: Who understands this? o.O   Who understands this? o.O I_icon_minitime

Back to top Go down
 
Who understands this? o.O
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
GaoGao :: Bag of sweets-
Jump to: