From fb58a93ff2207656725e01448cb8436d249724c1 Mon Sep 17 00:00:00 2001 From: Musa Ahmed Date: Wed, 5 Oct 2022 20:25:49 -0700 Subject: got main thingy working --- CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp | 42 ++++++++++----------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp') diff --git a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp index 71d06c9..8b1803b 100644 --- a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp +++ b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp @@ -16,44 +16,34 @@ using std::to_string; int main() { - string n1; - string n2; - string n3; - string n4; - - string g1; - string g2; - string g3; - string g4; - - string i1; - string i2; - string i3; - string i4; - + vector n; vector g; vector c; + string temp; for (int i = 0; i < 4; i++) { - cout << "enter a name" << endl; - cin >> n1; - n.push_back(n1); + cout << "Enter a name: " << endl; + cin >> temp; + n.push_back(temp); - cout << "enter a gpa" << endl; - cin >> g1; - g.push_back(g1); + cout << "Enter a gpa: " << endl; + cin >> temp; + g.push_back(temp); - cout << "enter an income" << endl; - cin >> i1; - c.push_back(i1); + cout << "Enter an income: " << endl; + cin >> temp; + c.push_back(temp); } - for (string i : n) { - cout << i << ' '; + for (int i = 0; i < 4; i ++) { + cout << "Profile #" << i << ' ' << + "Name: " << n[i] << ' ' << + "GPA: " << g[i] << ' ' << + "Income: " << c[i] << endl; } return 0; -- cgit v1.2.3