Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //multiTool.cpp
- #pragma once
- #include <iostream>
- #include <math.h>
- #include "multiTool.h"
- using namespace std;
- int main()
- {
- int Q1;
- cout << "Input number corresponding to operation" << endl;
- cout << "1. Quadratic Calculator" << endl;
- cout << "2. Coordinate Distance and Midpoint Calculator" << endl;
- cout << "3. Celsius to Fahrenheit" << endl;
- cout << "4. Fahrenheit to Celsius" << endl;
- cin >> Q1;
- switch(Q1)
- {
- case 1:
- quadCalc();
- case 2:
- coordDistCalc();
- case 3:
- celToFahr();
- case 4:
- fahrToCel();
- }
- #pragma region quadCalc
- void quadCalc()
- {
- double a, b, c, A1, A2, X1, X2;
- cout << "Input value for a: ";
- cin >> a;
- cout << "Input value for b: ";
- cin >> b;
- cout << "Input value for c: ";
- cin >> c;
- A1 = (b*b)-(4*a*c);
- A2 = sqrt(A1);
- X1 = ((-(b)) + A2)/(2*a);
- X2 = ((-(b)) - A2)/(2*a);
- cout << "The answer is x= " + X1 + ", " + X2 << endl;
- System("PAUSE");
- }
- #pragma endregion quadCalc
- #pragma region coordDistCalc
- void coordDistCalc()
- {
- }
- #pragma endregion
- #pragma region celToFahr
- void celToFahr()
- {
- double Q1, A1, A2;
- cout << "Input temperature to be changed to Fahrenheit: ";
- cin >> Q1;
- A1 = ((Q1*9)/5);
- A2 = A1+32;
- cout << Q1 + "C in Fahrenheit is: " + A2 << endl;
- System("PAUSE");
- }
- #pragma endregion
- #pragma region fahrToCel
- void fahrToCel()
- {
- double Q1, A1, A2;
- cout << "Input temperature to be changed to Celsius: ";
- cin >> Q1;
- A1 = ((Q1-32)*5);
- A2 = A1/9;
- cout << Q1 + "F in Celsius is: " + A2 << endl;
- System("PAUSE");
- }
- #pragma endregion
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement