From c237e0c92ecee53ed7352b83c69da9aabafcd26b Mon Sep 17 00:00:00 2001 From: SR Tamim Date: Sat, 9 Mar 2024 00:29:25 +0600 Subject: calculation of total heat fixed --- headers/readElementState.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 headers/readElementState.cpp (limited to 'headers/readElementState.cpp') 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 +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; +} -- cgit v1.2.3