Revert "I forgot to save the files before commiting, sorry"
This reverts commit 368d3ac16f
.
This commit is contained in:
parent
368d3ac16f
commit
494f8713d5
|
@ -11,13 +11,11 @@ int main()
|
||||||
bool loop = true;
|
bool loop = true;
|
||||||
while (loop)
|
while (loop)
|
||||||
{
|
{
|
||||||
//asks YOU that dumb question thing I made lol
|
|
||||||
std::cout << "Please select an option from the list:\n";
|
std::cout << "Please select an option from the list:\n";
|
||||||
std::cout << "1: Add | 2: Subtract | 3: Divide | 4: Multiply | 5: Square root \n";
|
std::cout << "1: Add | 2: Subtract | 3: Divide | 4: Multiply | 5: Square root \n";
|
||||||
std::cout << "\n";
|
std::cout << "\n";
|
||||||
std::cin >> option;
|
std::cin >> option;
|
||||||
std::cout << "\n";
|
std::cout << "\n";
|
||||||
//asks your compooter a question
|
|
||||||
switch (option)
|
switch (option)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -38,23 +36,19 @@ int main()
|
||||||
total_num = square_root("Square root", false);
|
total_num = square_root("Square root", false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//Asks YOU ANOTHER DUMB, STUPID QUESTION!
|
|
||||||
std::cout << "Please choose an option from the list:" << '\n';
|
std::cout << "Please choose an option from the list:" << '\n';
|
||||||
std::cout << "1: Continue | 2: Conitnue with number from last problem | 3: Exit the program" << '\n';
|
std::cout << "1: Continue | 2: Conitnue with number from last problem | 3: Exit the program" << '\n';
|
||||||
std::cin >> end_option;
|
std::cin >> end_option;
|
||||||
//compooter question
|
|
||||||
if (end_option == 1)
|
if (end_option == 1)
|
||||||
{
|
{
|
||||||
loop = true;
|
loop = true;
|
||||||
}
|
}
|
||||||
//JEEZ!!! How many compooter questions are there????????!!!!
|
|
||||||
else if (end_option == 2)
|
else if (end_option == 2)
|
||||||
{
|
{
|
||||||
std::cout << "Please select an option from the list:\n";
|
std::cout << "Please select an option from the list:\n";
|
||||||
std::cout << "1: Add | 2: Subtract | 3: Divide | 4: Multiply | 5: Square root \n";
|
std::cout << "1: Add | 2: Subtract | 3: Divide | 4: Multiply | 5: Square root \n";
|
||||||
int option2;
|
int option2;
|
||||||
std::cin >> option2;
|
std::cin >> option2;
|
||||||
//MORE!????
|
|
||||||
switch (option2)
|
switch (option2)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -74,7 +68,6 @@ int main()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//EVEN MOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOORE?????!!!!!!!!!!!????!?!??!?!?!?
|
|
||||||
else if (end_option == 3)
|
else if (end_option == 3)
|
||||||
{
|
{
|
||||||
loop = false;
|
loop = false;
|
||||||
|
|
|
@ -6,14 +6,11 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
static double ans = 0;
|
static double ans = 0;
|
||||||
bool loop2 = true;
|
bool loop2 = true;
|
||||||
//Yeah, this is like um a thing that makes your computer do... stuff
|
|
||||||
double math(std::string text, std::function<double(double, double)> code, bool use_last_num, std::string math_symbol)
|
double math(std::string text, std::function<double(double, double)> code, bool use_last_num, std::string math_symbol)
|
||||||
{
|
{
|
||||||
//Don't worry about these it's just like a thing that makes your computer like store data
|
|
||||||
double total_num = 0;
|
double total_num = 0;
|
||||||
double num1 = 0;
|
double num1 = 0;
|
||||||
double num2 = 0;
|
double num2 = 0;
|
||||||
//This like.. asks your computer like um like um uh asks your computer a question
|
|
||||||
if (!use_last_num)
|
if (!use_last_num)
|
||||||
{
|
{
|
||||||
std::cout << text << "\n";
|
std::cout << text << "\n";
|
||||||
|
@ -27,7 +24,6 @@ double math(std::string text, std::function<double(double, double)> code, bool u
|
||||||
std::cout << num1 << math_symbol << num2 << " = " << total_num << "\n";
|
std::cout << num1 << math_symbol << num2 << " = " << total_num << "\n";
|
||||||
std::cout << "\n";
|
std::cout << "\n";
|
||||||
}
|
}
|
||||||
//This just asks your computer another question, Don't worry about it
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << text << "\n" << "\n";
|
std::cout << text << "\n" << "\n";
|
||||||
|
@ -42,11 +38,9 @@ double math(std::string text, std::function<double(double, double)> code, bool u
|
||||||
}
|
}
|
||||||
return total_num;
|
return total_num;
|
||||||
}
|
}
|
||||||
//moooooooooooore stuffffffffffffffffffffffffffffff
|
|
||||||
double square_root(std::string text, bool use_last_num)
|
double square_root(std::string text, bool use_last_num)
|
||||||
{
|
{
|
||||||
double total_num;
|
double total_num;
|
||||||
//asks ANOTHER question
|
|
||||||
if (!use_last_num)
|
if (!use_last_num)
|
||||||
{
|
{
|
||||||
std::cout << text << '\n';
|
std::cout << text << '\n';
|
||||||
|
@ -58,7 +52,6 @@ double square_root(std::string text, bool use_last_num)
|
||||||
std::cout << "The square root of " << sqrt_num << " = " << total_num << "\n";
|
std::cout << "The square root of " << sqrt_num << " = " << total_num << "\n";
|
||||||
std::cout << "\n";
|
std::cout << "\n";
|
||||||
}
|
}
|
||||||
//and ANOTHER
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
total_num = sqrt(ans);
|
total_num = sqrt(ans);
|
||||||
|
@ -66,4 +59,3 @@ double square_root(std::string text, bool use_last_num)
|
||||||
}
|
}
|
||||||
return total_num;
|
return total_num;
|
||||||
}
|
}
|
||||||
//Phew, we're done
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
//Just don't worry about ANYTHING, OK?
|
|
||||||
double math(std::string text, std::function<double(double, double)> code, bool use_last_num, std::string math_symbol);
|
double math(std::string text, std::function<double(double, double)> code, bool use_last_num, std::string math_symbol);
|
||||||
double square_root(std::string, bool use_last_num);
|
double square_root(std::string, bool use_last_num);
|
Reference in a new issue