Skip to content

Commit

Permalink
Version 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HojdaAdelin committed Mar 29, 2023
1 parent b9f5251 commit f69c61f
Show file tree
Hide file tree
Showing 14 changed files with 468 additions and 204 deletions.
223 changes: 115 additions & 108 deletions components/calculator.cpp → Calculator/calculator.cpp
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();
}

}
}





}
6 changes: 3 additions & 3 deletions components/calculator.h → Calculator/calculator.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma

void simpleCalculator();
#pragma

void simpleCalculator();
int main();
Binary file modified Executable/ElevenTerminal.exe
Binary file not shown.
125 changes: 125 additions & 0 deletions Settings/menu.cpp
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;

}

}
Loading

0 comments on commit f69c61f

Please sign in to comment.