diff --git a/Computer Science Project 2/Computer Science Project 2/it works now b/Computer Science Project 2/Computer Science Project 2/it works now new file mode 100644 index 0000000..4596539 --- /dev/null +++ b/Computer Science Project 2/Computer Science Project 2/it works now @@ -0,0 +1,53 @@ +#include // gives access to cin, cout, cnd1, <<, >>, boolalpha, noboolalpha +#include // gives access to _kbhit() and _getch() for pause() +#include // power function pow +// Namespaces +using namespace std; //* + // Functions() +void pause() { + cout << "Press any key to continue . . ."; + while (!_kbhit()); + _getch(); + cout << '/n'; +} +// MAIN +void main() { + // Variables + int potato = 0; + float tomato = 0; + double tomatoes = 0; + bool beet_root = false; // assume no one has beet roots + char frisk; + int calc_1 = 0, calc_2 = 0, calc_3 = 0; + + // User Queries + cout << "How many potatoes do you have? "; + cin >> potato; //int + cout << "How much tomato sauce doesthe recipe call for in ounces? "; + cin >> tomato; // float? + cout << "How many tomatoes do you think exist on the planet in mols? "; + cin >> tomatoes; + cout << "Do you have a beet root : Y/N "; + cin >> frisk; + if (frisk == 'Y' || frisk == 'y') { + beet_root = true; // freely changes the value from false to true + } + + // Print out stored data + cout << "You have " << potato << "number of potatoes. \n"; + cout << "You need " << tomato << " ounces of tomato sauce for your recipe." << endl; + cout << "You think approximately " << tomatoes * 6.022 * pow(10.0, 23) << "tomatoes exist on the earth." << '\n'; + cout << boolalpha << "The answer evaluation of you have beet root is " << beet_root << endl; + + // Change Values + + cout << "2"; + cin >> calc_1; + cout << "1"; + cin >> calc_2; + cout << calc_1 << " + " << calc_2 << "=" << calc_1 + calc_2 << endl; + calc_3 = calc_1 * calc_2; + cout << calc_1 << "*" << calc_2 << "=" << calc_3 << endl; + // Pause + pause(); +}