Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DOWNLOAD LINK:
- https://mega.nz/#!BdNTDY7B!bwlGx0K3w9VjGBostimSftiixfbS05rcI7Oweohetgs
- ===========================================================================
- #include <iostream>
- #include <stdio.h>
- #include <windows.h>
- #include <math.h>
- #include <iomanip>
- #include <fstream>
- #include <conio.h>
- #include "resource.h"
- using namespace std;
- int convertionDegrees();
- int areaOfTriangle();
- int areaOfCircle();
- int areaOfRectangle();
- int converter();
- int areas();
- int otherOperations();
- int linksAndStuff();
- int help();
- //MAIN FUNCTION/BASIC CALCULATION
- int main()
- {
- system("mode 70, 23");
- SetConsoleTitle("C++ CALCULATOR by Wolfiy v2.4.2");
- double num1, num2;
- for (int choiceFirstPage; choiceFirstPage != 1 || 2 || 3 || 4 || 5 || 6 || 9;){
- system("cls");
- cout << "\n\n Please select what do you want to do:\n\n" << endl;
- cout << "\11" << "1. Addition\n\n" << "\11" << "2. Subtraction\n\n" << "\11" << "3. Multiplication\n\n"
- << "\11" << "4. Division\n\n" << "\11" << "5. Links and other stuff\n\n" << "\11" << "6. More\n\n" << "\11" << "7. Help\n\n\n 9. Leave\n\n" << endl;
- cin >> choiceFirstPage;
- switch(choiceFirstPage){
- case 1:
- {
- system("cls");
- cout << "\n\n Select two numbers you'd like to add:\n" << endl;
- cout << "\11"; cin >> num1;
- cout << "\11"; cin >> num2;
- cout << "\n\11" << num1 << " + " << num2 << " = " << num1+num2 << endl;
- cin.ignore();
- getchar();
- break;
- }
- case 2:
- {
- system("cls");
- cout << "\n\n Select two numbers you'd like to subtract:\n" << endl;
- cout << "\11"; cin >> num1;
- cout << "\11"; cin >> num2;
- cout << "\n\11" << num1 << " - " << num2 << " = " << num1-num2 << endl;
- cin.ignore();
- getchar();
- break;
- }
- case 3:
- {
- system("cls");
- cout << "\n\n Select two numbers you'd like to multiply:\n" << endl;
- cout << "\11"; cin >> num1;
- cout << "\11"; cin >> num2;
- cout << "\n\11" << num1 << " * " << num2 << " = " << num1*num2 << endl;
- cin.ignore();
- getchar();
- break;
- }
- case 4:
- {
- system("cls");
- cout << "\n\n Select two numbers you'd like to divide:\n" << endl;
- cout << "\11"; cin >> num1;
- cout << "\11"; cin >> num2;
- cout << "\n\11" << num1 << " / " << num2 << " = " << num1/num2 << endl;
- cin.ignore();
- getchar();
- break;
- }
- case 5:
- {
- linksAndStuff();
- break;
- }
- case 6:
- {
- otherOperations();
- break;
- }
- case 7:
- {
- help();
- break;
- }
- case 9:
- {
- exit(0);
- }
- default:
- {
- system("cls");
- cout << "\n [ERROR]\n\n\n This isn't a valid choice!\n\n" << endl;
- getchar();
- break;
- }
- }
- }
- return 0;
- }
- int help(){
- string install;
- for (int choiceHelp; choiceHelp != 1|| 2 || 3;){
- system("cls");
- cout << "\n\n Please select something:\n\n" << endl;
- cout << "\11" << "1. Correct Installation\n\n\11" << "2. Shortcut\n\n\11" << "3. Get the calculator in the Windows search\n\n\n\n\n\n\n\n\n\n 8. Back 9. Leave\n\n" << endl;
- cin >> choiceHelp;
- switch(choiceHelp){
- case 1:
- {
- ShellExecute(0, "open", "Files\\installation.txt", 0, 0, SW_SHOWNORMAL);
- break;
- }
- case 2:
- {
- ShellExecute(0, "open", "Files\\shortcut.txt", 0, 0, SW_SHOWNORMAL);
- break;
- }
- case 3:
- {
- ShellExecute(0, "open", "Files\\in_windows_search.txt", 0, 0, SW_SHOWNORMAL);
- break;
- }
- case 8:
- {
- main();
- break;
- }
- case 9:
- {
- exit(0);
- }
- }
- }
- return 0;
- }
- int linksAndStuff(){
- for (long choiceLinksAndStuff; choiceLinksAndStuff != 1|| 2 || 3 || 5 || 9 || 1000101;){
- system("cls");
- cout << "\n\n Please select what you'd like to see:\n\n" << endl;
- cout << "\11" << "1. YouTube\n\n\11" << "2. Instagram\n\n\11" << "3. Pastebin\n\n\11" << "4. Source code\n\n\11"
- << "5. 1st Version Source Code\n\n\n\n\n\n 8. Back 9. Leave\n\n" << endl;
- cin >> choiceLinksAndStuff;
- if (choiceLinksAndStuff == 1000101){
- ShellExecute(0, "open", "Files\\That's not an easter egg.exe", 0, 0, SW_SHOWNORMAL);
- }
- else if (choiceLinksAndStuff == 1){
- ShellExecute(0, "open", "https://www.YouTube.com/DarkWolfiiy", 0, 0, SW_SHOWNORMAL);
- }
- else if (choiceLinksAndStuff == 2){
- ShellExecute(0, "open", "https://www.Instagram.com/Page4Bronies", 0, 0, SW_SHOWNORMAL);
- }
- else if (choiceLinksAndStuff == 3){
- ShellExecute(0, "open", "https://pastebin.com/u/ItsWolfiy", 0, 0, SW_SHOWNORMAL);
- }
- else if (choiceLinksAndStuff == 4){
- ShellExecute(0, "open", "Files\\Source Codes\\Source Code.txt", 0, 0, SW_SHOWNORMAL);
- }
- else if (choiceLinksAndStuff == 5){
- ShellExecute(0, "open", "Files\\Source Codes\\Source Code (v.1).txt", 0, 0, SW_SHOWNORMAL);
- }
- else if (choiceLinksAndStuff == 8){
- main();
- }
- else if (choiceLinksAndStuff == 9){
- exit(0);
- }
- else{
- system("cls");
- cout << "\n [ERROR]\n\n\n This isn't a valid choice!\n\n" << endl;
- getchar();
- }
- }
- return 0;
- }
- //2ND PAGE OF POSSIBILITIES/MODULO/POWERS/OTHERS
- int otherOperations()
- {
- int modulo1, modulo2;
- double numToPow, power;
- for (int choiceSecondPage; choiceSecondPage != 1 || 2 || 3 || 4 || 8 || 9;){
- system("cls");
- cout << "\n\n Please select what do you want to do:\n\n" << endl;
- cout << "\11" <<"1. Modulo\n\n" << "\11" << "2. Powers\n\n" << "\11" << "3. Areas\n\n" << "\11" <<"4. Converter\n\n\n\n\n\n\n\n 8. Back 9. Leave\n\n" << endl;
- cin >> choiceSecondPage;
- switch(choiceSecondPage){
- case 1:
- {
- system("cls");
- cout << "\n\n Select two numbers you'd like the modulo:\n" << endl;
- cout << "\11"; cin >> modulo1;
- cout << "\11"; cin >> modulo2;
- cout << "\n\11" << modulo1 << " % " << modulo2 << " = " << modulo1%modulo2 << endl;
- cin.ignore();
- getchar();
- break;
- }
- case 2:
- {
- system("cls");
- cout << "\n\n Select the number you'd like to know the power:\n" << endl;
- cout << "\11"; cin >> numToPow;
- cout << "\n\n Select the power you want:\n" << endl;
- cout << "\11"; cin >> power;
- cout << "\n\11" << numToPow << " ^ " << power << " = " << pow(numToPow, power) << endl;
- cin.ignore();
- getchar();
- break;
- }
- case 3:
- {
- areas();
- break;
- }
- case 4:
- {
- converter();
- break;
- }
- case 8:
- {
- main();
- break;
- }
- case 9:
- {
- exit(0);
- }
- default:
- {
- system("cls");
- cout << "\n [ERROR]\n\n\n This isn't a valid choice!\n\n" << endl;
- getchar();
- break;
- }
- }
- }
- return 0;
- }
- //CONVERTER
- int converter(){
- for (int choiceConverter; choiceConverter != 1 || 2 || 3;){
- system("cls");
- cout << "\n\n Please select what you'd like to do:\n\n" << endl;
- cout << "\11" << "1. Degrees\n\n\n\n\n\n\n\n 8. Back 9. Leave\n\n" << endl;
- cin >> choiceConverter;
- switch(choiceConverter){
- case 1:
- {
- convertionDegrees();
- break;
- }
- case 8:
- {
- otherOperations();
- break;
- }
- case 9:
- {
- exit(0);
- }
- }
- }
- return 0;
- }
- //AREAS
- int areas(){
- for (int choiceAreas; choiceAreas != 1 || 2 || 3 || 4 || 8 || 9;){
- system("cls");
- cout << "\n\n Please select what area you'd like to calculate:\n\n" << endl;
- cout << "\11" << "1. Square\n\n" << "\11" << "2. Rectangle\n\n" << "\11" << "3. Circle\n\n" << "\11" << "4. Triangle\n\n\n\n\n\n\n\n 8. Back 9. Leave\n\n" << endl;
- cin >> choiceAreas;
- switch(choiceAreas){
- case 1:
- {
- double squareSide;
- system("cls");
- cout << "\n\n Please, insert the length of the side of the square:\n\n" << endl;
- cout << "\11"; cin >> squareSide;
- cout << "\n\11" << squareSide << " ^ 2 = " << pow(squareSide, 2) << endl;
- cin.ignore();
- getchar();
- break;
- }
- case 2:
- {
- areaOfRectangle();
- break;
- }
- case 3:
- {
- areaOfCircle();
- break;
- }
- case 4:
- {
- areaOfTriangle();
- break;
- }
- case 8:
- {
- otherOperations();
- break;
- }
- case 9:
- {
- exit(0);
- }
- default:
- {
- system("cls");
- cout << "\n [ERROR]\n\n\n This isn't a valid choice!\n\n" << endl;
- getchar();
- break;
- }
- }
- }
- return 0;
- }
- //AREA OF RECTANGLES
- int areaOfRectangle(){
- double width;
- double height;
- system("cls");
- cout << "\n\n Please, insert the width of your rectangle:\n" << endl;
- cout << "\11"; cin >> width;
- cout << "\n\n Now insert the height of your rectangle:\n" << endl;
- cout << "\11"; cin >> height;
- double areaRectangle = width*height;
- cout << "\n\11" << width << " * " << height << " = " << areaRectangle << endl;
- cin.ignore();
- getchar();
- return areaRectangle;
- }
- //AREA OF CIRCLE
- int areaOfCircle(){
- double radius;
- long double pi = atan(1)*4;
- system("cls");
- cout << "\n\n Please, insert the radius of your circle:\n" << endl;
- cout << "\11"; cin >> radius;
- double areaCircle = pi*pow(radius, 2);
- cout << "\n\11" << pi << " * " << radius << "^2 = " << setprecision(7) << areaCircle << endl;
- cin.ignore();
- getchar();
- return areaCircle;
- }
- //AREA OF TRIANGLE
- int areaOfTriangle(){
- double base;
- double height;
- system("cls");
- cout << "\n\n Please, insert the base of your triangle:\n" << endl;
- cout << "\11"; cin >> base;
- cout << "\n\n Now, insert the vertical height of your triangle:\n" << endl;
- cout << "\11"; cin >> height;
- double areaTriangle = 0.5*base*height;
- cout << "\n\11" << "0.5 * " << base << " * " << height << " = " << areaTriangle << endl;
- cin.ignore();
- getchar();
- return areaTriangle;
- }
- //CONVERTION OF DEGREES
- int convertionDegrees(){
- double celsius;
- double fahrenheit;
- for (int choiceConvDeg; choiceConvDeg != 1 || 2;){
- system("cls");
- cout << "\n\n Please select what you'd like to convert:\n\n" << endl;
- cout << "\11" << "1. Celsius to Fahrenheit\n\n" << "\11" << "2. Fahrenheit to Celsius\n\n\n\n\n\n\n\n\n\n\n 8. Back 9. Leave\n\n" << endl;
- cin >> choiceConvDeg;
- switch(choiceConvDeg){
- case 1:
- {
- system("cls");
- cout << "\n\n Please insert the amount of degree Celsius:\n\n" << endl;
- cout << "\11"; cin >> celsius;
- double fahrenheit = (celsius*1.8) + 32;
- cout << "\n\11" << celsius << "\370" << "C = " << fahrenheit << "\370" << "F" << endl;
- cin.ignore();
- getchar();
- break;
- }
- case 2:
- {
- system("cls");
- cout << "\n\n Please insert the amount of degree Fahrenheit:\n\n" << endl;
- cout << "\11"; cin >> fahrenheit;
- double celsius = (fahrenheit - 32) / 1.8;
- cout << "\n\11" << fahrenheit << "\370C = " << celsius << "\370F" << endl;
- cin.ignore();
- getchar();
- break;
- }
- case 8:
- {
- converter();
- break;
- }
- case 9:
- {
- exit(0);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement