I forgot to save the files before commiting, sorry

This commit is contained in:
T4rtP1ck13 2021-06-21 22:15:24 -05:00
parent 3b88e4bde5
commit 368d3ac16f
3 changed files with 17 additions and 1 deletions

View file

@ -11,11 +11,13 @@ int main()
bool loop = true;
while (loop)
{
//asks YOU that dumb question thing I made lol
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 << "\n";
std::cin >> option;
std::cout << "\n";
//asks your compooter a question
switch (option)
{
case 1:
@ -36,19 +38,23 @@ int main()
total_num = square_root("Square root", false);
break;
}
//Asks YOU ANOTHER DUMB, STUPID QUESTION!
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::cin >> end_option;
//compooter question
if (end_option == 1)
{
loop = true;
}
//JEEZ!!! How many compooter questions are there????????!!!!
else if (end_option == 2)
{
std::cout << "Please select an option from the list:\n";
std::cout << "1: Add | 2: Subtract | 3: Divide | 4: Multiply | 5: Square root \n";
int option2;
std::cin >> option2;
//MORE!????
switch (option2)
{
case 1:
@ -68,6 +74,7 @@ int main()
break;
}
}
//EVEN MOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOORE?????!!!!!!!!!!!????!?!??!?!?!?
else if (end_option == 3)
{
loop = false;

View file

@ -6,11 +6,14 @@
using namespace std;
static double ans = 0;
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)
{
//Don't worry about these it's just like a thing that makes your computer like store data
double total_num = 0;
double num1 = 0;
double num2 = 0;
//This like.. asks your computer like um like um uh asks your computer a question
if (!use_last_num)
{
std::cout << text << "\n";
@ -24,6 +27,7 @@ double math(std::string text, std::function<double(double, double)> code, bool u
std::cout << num1 << math_symbol << num2 << " = " << total_num << "\n";
std::cout << "\n";
}
//This just asks your computer another question, Don't worry about it
else
{
std::cout << text << "\n" << "\n";
@ -38,9 +42,11 @@ double math(std::string text, std::function<double(double, double)> code, bool u
}
return total_num;
}
//moooooooooooore stuffffffffffffffffffffffffffffff
double square_root(std::string text, bool use_last_num)
{
double total_num;
//asks ANOTHER question
if (!use_last_num)
{
std::cout << text << '\n';
@ -52,10 +58,12 @@ double square_root(std::string text, bool use_last_num)
std::cout << "The square root of " << sqrt_num << " = " << total_num << "\n";
std::cout << "\n";
}
//and ANOTHER
else
{
total_num = sqrt(ans);
std::cout << "The square root of " << ans << " = " << total_num;
}
return total_num;
}
}
//Phew, we're done

View file

@ -1,5 +1,6 @@
#include <iostream>
#include <cmath>
#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 square_root(std::string, bool use_last_num);