-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9f5251
commit f69c61f
Showing
14 changed files
with
468 additions
and
204 deletions.
There are no files selected for viewing
223 changes: 115 additions & 108 deletions
223
components/calculator.cpp → Calculator/calculator.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,116 @@ | ||
#include <iostream> | ||
#include "calculator.h" | ||
#include <math.h> | ||
|
||
using namespace std; | ||
|
||
void simpleCalculator() { | ||
|
||
int number1, number2, result, aws, operation; | ||
|
||
cout << "Eleven Terminal - Calculator" << endl; | ||
cout << "Select the operation:" << endl; | ||
cout << "\n[1] +" << endl; | ||
cout << "[2] -" << endl; | ||
cout << "[3] *" << endl; | ||
cout << "[4] /" << endl; | ||
cout << "[5] %" << endl; | ||
cout << "[6] sqrt" << endl; | ||
cout << endl; | ||
cin >> operation; | ||
|
||
cout << "\nEnter 2 numbers" << endl; | ||
cin >> number1 >> number2; | ||
|
||
switch (operation) { | ||
case 1: | ||
cout << endl; | ||
cout << number1 << " + " << number2 << " = " << number1 + number2; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
case 2: | ||
cout << endl; | ||
cout << number1 << " - " << number2 << " = " << number1 - number2; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
case 3: | ||
cout << endl; | ||
cout << number1 << " * " << number2 << " = " << number1 * number2; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
case 4: | ||
cout << endl; | ||
cout << number1 << " / " << number2 << " = " << number1 / number2; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
case 5: | ||
cout << endl; | ||
cout << number1 << " % " << number2 << " = " << number1 % number2; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
case 6: | ||
cout << "\nSQRT " << number1 << " = " << sqrt(number1) << "\nSQRT " << number2 << " = " << sqrt(number2) << endl; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
|
||
|
||
} | ||
|
||
|
||
|
||
#include <iostream> | ||
#include "calculator.h" | ||
#include <math.h> | ||
|
||
using namespace std; | ||
|
||
void simpleCalculator() { | ||
|
||
int number1, number2, result, aws, operation; | ||
|
||
cout << "Eleven Terminal - Calculator" << endl; | ||
cout << "Select the operation:" << endl; | ||
cout << "\n[1] +" << endl; | ||
cout << "[2] -" << endl; | ||
cout << "[3] *" << endl; | ||
cout << "[4] /" << endl; | ||
cout << "[5] %" << endl; | ||
cout << "[6] sqrt" << endl; | ||
cout << "\n[0] Exit" << endl; | ||
cout << endl; | ||
cin >> operation; | ||
|
||
if (operation == 0) { | ||
system("cls"); | ||
main(); | ||
} else { | ||
cout << "\nEnter 2 numbers" << endl; | ||
cin >> number1 >> number2; | ||
|
||
switch (operation) { | ||
case 1: | ||
cout << endl; | ||
cout << number1 << " + " << number2 << " = " << number1 + number2; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
case 2: | ||
cout << endl; | ||
cout << number1 << " - " << number2 << " = " << number1 - number2; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
case 3: | ||
cout << endl; | ||
cout << number1 << " * " << number2 << " = " << number1 * number2; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
case 4: | ||
cout << endl; | ||
cout << number1 << " / " << number2 << " = " << number1 / number2; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
case 5: | ||
cout << endl; | ||
cout << number1 << " % " << number2 << " = " << number1 % number2; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
case 6: | ||
cout << "\nSQRT " << number1 << " = " << sqrt(number1) << "\nSQRT " << number2 << " = " << sqrt(number2) << endl; | ||
cout << "\n\n[8] Retry" << endl; | ||
cout << "[9] Exit" << endl; | ||
cin >> aws; | ||
if (aws == 9) { | ||
system("cls"); | ||
main(); | ||
} else if (aws == 8) { | ||
system("cls"); | ||
simpleCalculator(); | ||
} | ||
|
||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#pragma | ||
|
||
void simpleCalculator(); | ||
#pragma | ||
|
||
void simpleCalculator(); | ||
int main(); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
#include "settings.h" | ||
|
||
using namespace std; | ||
|
||
void menu_config(); | ||
int menuch; | ||
int global_menu; | ||
|
||
void menu() { | ||
|
||
cout << "Eleven Terminal - Menu" << endl; | ||
cout << "\n[1] Default menu" << endl; | ||
cout << "[2] Old menu" << endl; | ||
cout << "\n[8] Menu" << endl; | ||
cout << endl; | ||
cin >> menuch; | ||
|
||
if (menuch == 1) { | ||
|
||
menu_config(); | ||
menu(); | ||
|
||
} else if (menuch == 2) { | ||
|
||
menu_config(); | ||
menu(); | ||
|
||
} else if (menuch == 8) { | ||
|
||
system("cls"); | ||
settin(); | ||
|
||
} | ||
|
||
} | ||
|
||
void menu_config() { | ||
|
||
ofstream writeMenu("menu.cfg"); | ||
|
||
writeMenu << menuch << endl; | ||
|
||
writeMenu.close(); | ||
|
||
} | ||
|
||
void load_menu() { | ||
|
||
ifstream readMenu("menu.cfg"); | ||
|
||
readMenu >> global_menu; | ||
|
||
readMenu.close(); | ||
|
||
if (global_menu == 1) { | ||
|
||
cout << "Welcome to Eleven Terminal!" << endl; | ||
cout << "\n|| Algebra ||" << endl; | ||
cout << "[1] Clasic calculator" << endl; | ||
cout << "[2] Algebra calculations" << endl; | ||
cout << "[3] Percent calculation" << endl; | ||
cout << "[4] Complex calculations" << endl; | ||
|
||
cout << "\n|| Geometry ||" << endl; | ||
cout << "[5] Geometric Area" << endl; | ||
cout << "[6] Geometry calculation" << endl; | ||
|
||
cout << "\n|| Informations ||" << endl; | ||
cout << "[7] Info" << endl; | ||
cout << "[8] Tutorials" << endl; | ||
cout << "[9] About" << endl; | ||
cout << "[10] Updates" << endl; | ||
|
||
cout << "\n|| Customize ||" << endl; | ||
cout << "[11] Settings" << endl; | ||
|
||
} else if (global_menu == 2) { | ||
|
||
cout << "Welcome to Eleven Terminal!" << endl; | ||
|
||
cout << "\n[1] Clasic calculator" << endl; | ||
cout << "[2] Algebra calculations" << endl; | ||
cout << "[3] Percent calculation" << endl; | ||
cout << "[4] Complex calculations" << endl; | ||
|
||
|
||
cout << "[5] Geometric Area" << endl; | ||
cout << "[6] Geometry calculation" << endl; | ||
|
||
|
||
cout << "\n[7] Info" << endl; | ||
cout << "[8] Tutorials" << endl; | ||
cout << "[9] About" << endl; | ||
cout << "[10] Updates" << endl; | ||
|
||
|
||
cout << "[11] Settings" << endl; | ||
|
||
} else { | ||
|
||
cout << "Welcome to Eleven Terminal!" << endl; | ||
cout << "\n|| Algebra ||" << endl; | ||
cout << "[1] Clasic calculator" << endl; | ||
cout << "[2] Algebra calculations" << endl; | ||
cout << "[3] Percent calculation" << endl; | ||
cout << "[4] Complex calculations" << endl; | ||
|
||
cout << "\n|| Geometry ||" << endl; | ||
cout << "[5] Geometric Area" << endl; | ||
cout << "[6] Geometry calculation" << endl; | ||
|
||
cout << "\n|| Informations ||" << endl; | ||
cout << "[7] Info" << endl; | ||
cout << "[8] Tutorials" << endl; | ||
cout << "[9] About" << endl; | ||
cout << "[10] Updates" << endl; | ||
|
||
cout << "\n|| Customize ||" << endl; | ||
cout << "[11] Settings" << endl; | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.