// Name: Musa Ahmed, Course: CST116, Lab # 0, Learn how to debug and how to use an IDE as well as GitHub #include #include #include #include #include #include using namespace std; using std::cout; using std::cin; using std::endl; using std::string; using std::to_string; int main() { vector n; vector g; vector c; float gpa; string temp; for (int i = 0; i < 4; i++) { bool isDecimal = false; bool isString = false; cout << "Enter a name: " << endl; cin >> temp; /* while (isString == false) { for (int i = 0; temp[i]; i++) { if (isdigit(temp[i]) == false) { isString = true; break; } } if (isString = true) { break; } cout << "Please Enter a String!" << endl; cin >> temp; } */ n.push_back(temp); cout << "Enter a decimal gpa: " << endl; cin >> temp; while (isDecimal == false) { for (int i = 0; temp[i]; i++) { if (temp[i] == '.') { isDecimal = true; break; } } if (isDecimal == true) { break; } cout << "Please enter a Decimal!" << endl; cin >> temp; } float val = (int)(stod(temp) * 100 + 0.5); gpa = (float)val / 100; g.push_back(to_string(gpa)); cout << "Enter an income: " << endl; cin >> temp; c.push_back(temp); } for (int i = 0; i < 4; i ++) { cout << "Profile #" << i << ' ' << "Name: " << n[i] << ' ' << "GPA: " << g[i] << ' ' << "Income: " << c[i] << endl; } return 0; }