|
You last visited: Today at 15:25
Advertisement
[Release]Create a calculator - with c++
Discussion on [Release]Create a calculator - with c++ within the Coding Releases forum part of the Coders Den category.
11/01/2011, 19:34
|
#1
|
elite*gold: 4
Join Date: Nov 2010
Posts: 3,320
Received Thanks: 845
|
[Release]Create a calculator - with c++
PHP Code:
#include
#include
using namespace std;
int main()
{
int rechenoptionen;
double number1; //always use float or double for number1 and 2
double number2;
cout << "Calculator create by exaple" << endl;
cout << "take your Choose" << endl;
cout << "one for plus" << endl;
cout << "tow for minus" << endl;
cout << "three for mutiply" << endl;
cout << "four for dividend" << endl;
cin >> rechenoptionen;
if (rechenoptionen == 1)
{
cout << "Plus..." << endl;
cout << "enter your first number" << endl;
cin >> number1;
cout << "enter your second number" << endl;
cin >> number2;
cout << number1 << " + " << number2 << " = " << (number1 + number2) << endl;
}
if (rechenoptionen == 2)
{
cout << "minus..." << endl;
cout << "enter your first number" << endl;
cin >> number1;
cout << "enter your second number" << endl;
cin >> number2;
cout << number1 << " - " << number2 << " = " << (number1 - number2) << endl;
}
if (rechenoptionen == 3)
{
cout << "multiple..." << endl;
cout << "enter your first number" << endl;
cin >> number1;
cout << "enter your second number" << endl;
cin >> number2;
cout << number1 << " X " << number2 << " = " << (number1 * number2) << endl;
}
if (rechenoptionen == 4)
{
cout << "dividend..." << endl;
cout << "enter your first number" << endl;
cin >> number1;
cout << "enter your second number" << endl;
cin >> number2;
cout << number1 << " : " << number2 << " = " << (number1 / number2) << endl;
}
system("PAUSE");
}
|
|
|
11/01/2011, 23:34
|
#2
|
elite*gold: 11
Join Date: Nov 2009
Posts: 1,247
Received Thanks: 363
|
Kommt  hinein!
Anstelle der vielen "If"s würde ich ein switch einbauen.
MfG
|
|
|
11/02/2011, 14:38
|
#3
|
elite*gold: 120
Join Date: Aug 2010
Posts: 7,448
Received Thanks: 2,756
|
Quote:
Originally Posted by BigM'
Kommt  hinein!
Anstelle der vielen "If"s würde ich ein switch einbauen.
MfG
|
Nein. Da rein darf es nur, wenn der Source erklärt ist. So ist es kein Tutorial sondern nur ein Snippet!
|
|
|
11/02/2011, 15:02
|
#4
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
|
#include <windows.h>
#include <iostream>
?
|
|
|
11/02/2011, 15:35
|
#5
|
elite*gold: 4
Join Date: Nov 2010
Posts: 3,320
Received Thanks: 845
|
Nein , befolg es genauso so wie ich es beschrieben habe.
So ist es nämlich richtig.
|
|
|
11/02/2011, 15:46
|
#6
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
|
Quote:
Originally Posted by Dr. John Dorian'
Nein , befolg es genauso so wie ich es beschrieben habe.
So ist es nämlich richtig.
|
Mag ja sein, dass ich mich mit C++ nicht besonders auskenne, jedoch mag ich mich erinnern, dass wenn du die cin bzw cout Befehle nutzen möchtest, auf den vorgefertigten "iostream" zugreifen musst und " system("PAUSE") " braucht die windows.h.
Wobei die meisten (soweit ich weiß) eher _getch() verwenden und den dazugehörigen conio.h header (header? ist das richtig?).
Aber du bist hier der Experte, also lass ich es mal
|
|
|
11/03/2011, 21:06
|
#7
|
elite*gold: 4
Join Date: Nov 2010
Posts: 3,320
Received Thanks: 845
|
Nein kein Experte , möglich wäre es nicht , weil man eine ganz neue struktur bräuchte.
|
|
|
11/03/2011, 22:26
|
#8
|
elite*gold: 11
Join Date: Nov 2009
Posts: 1,247
Received Thanks: 363
|
Quote:
Originally Posted by 〤Che〤
Nein. Da rein darf es nur, wenn der Source erklärt ist. So ist es kein Tutorial sondern nur ein Snippet!
|
Und somit nur Source eines Rechners, daher gehört es in den "kleinere Releases" Thread- dort gibt es genügend Rechner.
MfG
|
|
|
11/13/2011, 17:57
|
#9
|
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
|
Quote:
Originally Posted by Dr. John Dorian'
Nein , befolg es genauso so wie ich es beschrieben habe.
So ist es nämlich richtig.
|
Quote:
Originally Posted by Dr. John Dorian'
Nein kein Experte , möglich wäre es nicht , weil man eine ganz neue struktur bräuchte.
|
Wenn du #include keinen Pfad zu nem Header übergibst, ist es ein Syntax-Fehler.
Und man braucht windows.h und iostream für die verwendeten Funktionen.
Demnach lässt sich dein Code nicht compilen. Und eine neue Struktur würde dadurch nicht benötigt werden.
Kurz: Du redest Bullshit.
|
|
|
 |
Similar Threads
|
[Release] Asal Calculator
09/11/2012 - Flyff - 58 Replies
.
|
[Release]Fortification calculator
06/09/2012 - Dekaron Exploits, Hacks, Bots, Tools & Macros - 31 Replies
So yeah, here's something random! This tool calculates the chances of successfully upgrading an item or a number of items, from a selected fortification level to another one. Don't ask me why I made this. I guess I just had nothing better to do, and since I made it, why not release it? :D
Default Global A8 fortification rates are implemented in program, but it can load an itemupgrade.csv file (Both A1-A6 and A7+ architecture, so it can easily be used for private servers as well) and use...
|
[RELEASE]PSF EXP CALCULATOR
12/05/2009 - Soldier Front Hacks, Bots, Cheats & Exploits - 1 Replies
That's not a hack, just a little exp calculator. (Sorry if it's not the right place to post it)
Please read the ReadMe.txt before using. ;)
Size: 311Ko
Download Link : RapidShare: 1-CLICK Web hosting - Easy Filehosting
Or : MEGAUPLOAD - The leading online storage and file delivery service
|
All times are GMT +1. The time now is 15:28.
|
|