diff options
Diffstat (limited to 'headers/readElementState.cpp')
-rw-r--r-- | headers/readElementState.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/headers/readElementState.cpp b/headers/readElementState.cpp new file mode 100644 index 0000000..494594a --- /dev/null +++ b/headers/readElementState.cpp @@ -0,0 +1,26 @@ +#include <iostream> +using namespace std; + +string readElementState() +{ + string state; + cout << "1. Solid\n2. Liquid\n3. Gas" << endl; + int choice; + cin >> choice; + switch (choice) + { + case 1: + state = "Solid"; + break; + case 2: + state = "Liquid"; + break; + case 3: + state = "Gas"; + break; + default: + cout << "Invalid choice" << endl; + break; + } + return state; +} |