aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch5-Debugging
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
parentgpa precision (diff)
downloadcst116-proj1-aa521c9dfdfc275f327143bd35b44cdd17e92751.tar.xz
cst116-proj1-aa521c9dfdfc275f327143bd35b44cdd17e92751.zip
updated table
Diffstat (limited to 'CST116-Ch5-Debugging')
-rw-r--r--CST116-Ch5-Debugging/CST116-Ch5-Debugging.vcxproj2
-rw-r--r--CST116-Ch5-Debugging/CST116-Ch5-Debugging.vcxproj.filters2
-rw-r--r--CST116-Ch5-Debugging/CST116-Project1.cpp3
-rw-r--r--CST116-Ch5-Debugging/Project1.cpp103
4 files changed, 107 insertions, 3 deletions
diff --git a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.vcxproj b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.vcxproj
index 14878e5..4d8debf 100644
--- a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.vcxproj
+++ b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.vcxproj
@@ -127,7 +127,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="CST116-Project1.cpp" />
+ <ClCompile Include="Project1.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.vcxproj.filters b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.vcxproj.filters
index 3183238..3a09495 100644
--- a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.vcxproj.filters
+++ b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.vcxproj.filters
@@ -15,7 +15,7 @@
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="CST116-Project1.cpp">
+ <ClCompile Include="Project1.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
diff --git a/CST116-Ch5-Debugging/CST116-Project1.cpp b/CST116-Ch5-Debugging/CST116-Project1.cpp
index 5c42eba..cf57569 100644
--- a/CST116-Ch5-Debugging/CST116-Project1.cpp
+++ b/CST116-Ch5-Debugging/CST116-Project1.cpp
@@ -42,6 +42,7 @@ int main()
+
cout << "Enter a decimal gpa: " << endl;
cin >> temp;
@@ -63,7 +64,7 @@ int main()
cin >> temp;
}
- float val = roundf(stod(temp) * 100)/100;
+ double val = roundf(stod(temp) * 100)/100;
gpa = val;
g.push_back(to_string(gpa));
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