aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch5-Debugging/Project1.cpp
diff options
context:
space:
mode:
authorMusa Ahmed <[email protected]>2022-10-11 19:16:26 -0700
committerMusa Ahmed <[email protected]>2022-10-11 19:16:26 -0700
commitaa521c9dfdfc275f327143bd35b44cdd17e92751 (patch)
tree6f2685e661068b59bcf895fdecacfba644069777 /CST116-Ch5-Debugging/Project1.cpp
parentgpa precision (diff)
downloadcst116-proj1-aa521c9dfdfc275f327143bd35b44cdd17e92751.tar.xz
cst116-proj1-aa521c9dfdfc275f327143bd35b44cdd17e92751.zip
updated table
Diffstat (limited to 'CST116-Ch5-Debugging/Project1.cpp')
-rw-r--r--CST116-Ch5-Debugging/Project1.cpp103
1 files changed, 103 insertions, 0 deletions
diff --git a/CST116-Ch5-Debugging/Project1.cpp b/CST116-Ch5-Debugging/Project1.cpp
new file mode 100644
index 0000000..e7fc174
--- /dev/null
+++ b/CST116-Ch5-Debugging/Project1.cpp
@@ -0,0 +1,103 @@
+
+#include <iostream>
+#include <iomanip>
+#include <string>
+#include <list>
+#include <bitset>
+#include <vector>
+#include <math.h>
+
+using namespace std;
+using std::cout;
+using std::cin;
+using std::endl;
+using std::string;
+using std::to_string;
+
+int main()
+{
+ string n1;
+ string n2;
+ string n3;
+ string n4;
+
+
+ float g1;
+ float g2;
+ float g3;
+ float g4;
+
+
+ int c1;
+ int c2;
+ int c3;
+ int c4;
+
+ int spacer;
+
+
+
+ cout << "Enter a Name: " << endl;
+ cin >> n1;
+ cout << "Enter a GPA: " << endl;
+ cin >> g1;
+ cout << "Enter an Income: " << endl;
+ cin >> c1;
+
+
+
+ cout << "Enter a Name: " << endl;
+ cin >> n2;
+ cout << "Enter a GPA: " << endl;
+ cin >> g2;
+ cout << "Enter an Income: " << endl;
+ cin >> c2;
+
+
+
+ cout << "Enter a Name: " << endl;
+ cin >> n3;
+ cout << "Enter a GPA: " << endl;
+ cin >> g3;
+ cout << "Enter an Income: " << endl;
+ cin >> c3;
+
+
+
+ cout << "Enter a Name: " << endl;
+ cin >> n4;
+ cout << "Enter a GPA: " << endl;
+ cin >> g4;
+ cout << "Enter an Income: " << endl;
+ cin >> c4;
+
+ spacer = (n1.size() + n2.size() + n3.size() + n4.size()) / 4 + 5;
+
+ cout << left << setw(spacer) << "Name"
+ << left << setw(spacer) << "GPA"
+ << left << setw(spacer) << "Income"
+ << endl;
+
+ cout << left << setw(spacer) << n1 << " "
+ << left << setw(spacer) << g1
+ << left << setw(spacer) << c1
+ << endl;
+
+ cout << left << setw(spacer) << n2 << " "
+ << left << setw(spacer) << g2
+ << left << setw(spacer) << c2
+ << endl;
+
+ cout << left << setw(spacer) << n3 << " "
+ << left << setw(spacer) << g3
+ << left << setw(spacer) << c3
+ << endl;
+
+ cout << left << setw(spacer) << n4 << " "
+ << left << setw(spacer) << g4
+ << left << setw(spacer) << c4
+ << endl;
+
+
+ return 0;
+} \ No newline at end of file