aboutsummaryrefslogtreecommitdiff
path: root/headers/readElementState.cpp
blob: 494594ad1ce93d5dc22898b05d5138bbc015d700 (plain) (blame)
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
#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;
}