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


-=ATX=- is a community that specializes in graphics, machinima, and programming.
 
HomePortalLatest imagesSearchRegisterLog in

 

 simple calculator and source

Go down 
4 posters
AuthorMessage
RougeAttacker
Co-Leader
RougeAttacker


Number of posts : 37
Registration date : 2008-12-13

simple calculator and source Empty
PostSubject: simple calculator and source   simple calculator and source I_icon_minitimeThu Dec 18, 2008 12:48 am

http://rapidshare.com/files/174399846/Calculator.exe

Source:
======================================================================

#include<iostream>
using namespace std;

int main(void)
{

system("TITLE Calculator");
system("COLOR 3");
char cChar;
double dfirstnumber;
double dsecondnumber;
char cdoagain;

do
{
system("CLS");
cout << "please enter the first number that you would like to use" << endl;
cin >> dfirstnumber;
cout << "please enter the operation that you would like to complete" << " (+,-,* or /)" << endl;
cin >> cChar;
cout << "Please enter the second number you would like to use" << endl;
cin >> dsecondnumber;

switch (cChar)
{
case '+':
cout << "the answer is! " << dfirstnumber << " + " << dsecondnumber << " = " << (dfirstnumber + dsecondnumber) << endl;
break;

case '-':
cout << "the answer is! " << dfirstnumber << " - " << dsecondnumber << " = " << (dfirstnumber - dsecondnumber) << endl;
break;

case '*':
cout << "the answer is! " << dfirstnumber << " * " << dsecondnumber << " = " << (dfirstnumber * dsecondnumber) << endl;
break;

case 'x':
cout << "the answer is! " << dfirstnumber << " x " << dsecondnumber << " = " << (dfirstnumber * dsecondnumber) << endl;
break;

case '/':
if(dsecondnumber == 0) {
cout << "that is an invalid operation" << endl;
} else
{
cout << "the answer is! " << dfirstnumber << " / " << dsecondnumber << " = " << (dfirstnumber / dsecondnumber) << endl;
}
break;

default:
cout << "That is an invalid operation" << endl;
break;
}
cout << "would you like to start again? (y or n) " << endl;
cin >> cdoagain;
}while (cdoagain == 'Y' || cdoagain == 'y');
system("PAUSE");
return 0;
}
Back to top Go down
Viva La Saint!
Community Admin



Number of posts : 24
xFire: : saint2019
Registration date : 2008-12-23

simple calculator and source Empty
PostSubject: Re: simple calculator and source   simple calculator and source I_icon_minitimeTue Dec 23, 2008 7:40 pm

very nice
How long did it take you?
Back to top Go down
RougeAttacker
Co-Leader
RougeAttacker


Number of posts : 37
Registration date : 2008-12-13

simple calculator and source Empty
PostSubject: Re: simple calculator and source   simple calculator and source I_icon_minitimeTue Dec 23, 2008 8:40 pm

Like 5 minutes to do it
Back to top Go down
Sgt.Saber

Sgt.Saber


Number of posts : 29
Age : 27
Registration date : 2008-12-24

simple calculator and source Empty
PostSubject: Re: simple calculator and source   simple calculator and source I_icon_minitimeWed Dec 24, 2008 11:36 am

well, that made my head spin
nice...whatever that is Razz
Back to top Go down
Mobibluman3
Community Recruit
Mobibluman3


Number of posts : 39
Registration date : 2009-01-01

simple calculator and source Empty
PostSubject: Re: simple calculator and source   simple calculator and source I_icon_minitimeFri Jan 02, 2009 3:24 pm

hahahaha
Back to top Go down
Sponsored content





simple calculator and source Empty
PostSubject: Re: simple calculator and source   simple calculator and source I_icon_minitime

Back to top Go down
 
simple calculator and source
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Anthrax Community :: Programming Help :: C++-
Jump to: