1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
string introreq;
string invalue[5];
string tvalue[2];
int i = 0;
cout << "Welcome to the law of Sines / Cosines program.";
cout << '\n' << "Would you like an introduction? (yes/no) : ";
getline (cin, introreq);
if (introreq == "yes")
{
system("CLS");
cout << "For the purpose of working with triangles, there will be 6 variables;" << '\n' << "a, b, c, A, B, C";
cout << '\n' << '\n' << "All uppercase letters are angles, and all lowercase letters are sides.";
cout << '\n' << "Corresponding letters are opposite eachothers." << '\n' << "For example angle A is opposite side a";
cout << '\n' << '\n' << "If you do not have the requested variable, input " << '\"' << "n" << '\"';
cout << '\n' << "To input a number, type the number, and press Enter to continue.";
cout << '\n' << '\n' << "ONLY ENTER 3 VALUES";
cin.get();
}
system("CLS");
cout << "a: ";
getline(cin, invalue[0]);
if (invalue[0] != "n" && invalue[0] != "N")
{
tvalue[i] = invalue[0];
i++;
}
cout << "b: ";
if (invalue[1] != "n" && invalue[1] != "N")
{
tvalue[i] = invalue[1];
i++;
}
getline(cin, invalue[1]);
cout << "c: ";
getline(cin, invalue[2]);
if (invalue[2] != "n" && invalue[2] != "N")
{
tvalue[i] = invalue[2];
i++;
}
cout << "A: ";
getline(cin, invalue[3]);
if (invalue[3] != "n" && invalue[3] != "N")
{
tvalue[i] = invalue[3];
i++;
}
cout << "B: ";
getline(cin, invalue[4]);
if (invalue[4] != "n" && invalue[4] != "N")
{
tvalue[i] = invalue[4];
i++;
}
cout << "C: ";
getline(cin, invalue[5]);
if (invalue[5] != "n" && invalue[5] != "N")
{
tvalue[i] = invalue[5];
i++;
}
system("CLS");
cout << tvalue[0];
cout << '\n' << tvalue[1];
cout << '\n' << tvalue[2];
cin.get();
cin.get();
return 0;
}
|