diff options
| author | Batbold74 <[email protected]> | 2022-10-26 21:17:17 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-10-26 21:17:17 -0700 |
| commit | 1993f10b0881eb1df8f8e36e794728a36c9e4b6b (patch) | |
| tree | b1d21bfb662e31f2dced39195d3cdaaccea297d8 | |
| parent | Add files via upload (diff) | |
| download | cst116-ch10-debugging-batbold74-1993f10b0881eb1df8f8e36e794728a36c9e4b6b.tar.xz cst116-ch10-debugging-batbold74-1993f10b0881eb1df8f8e36e794728a36c9e4b6b.zip | |
Add files via upload
Oh. I have forgotten to change the file name
| -rw-r--r-- | CST116-Week5.Project1-Bold.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/CST116-Week5.Project1-Bold.cpp b/CST116-Week5.Project1-Bold.cpp new file mode 100644 index 0000000..efa2eeb --- /dev/null +++ b/CST116-Week5.Project1-Bold.cpp @@ -0,0 +1,77 @@ +#include <iostream>
+#include <iomanip>
+#include <string>
+
+
+using std::cin;
+using std::cout;
+using std::endl;
+using namespace std;
+using std::setw;
+using std::setprecision;
+using std::ios;
+
+int main()
+{
+ string Joe, Hana, Smith, Troy;
+ float income1 = 57000.383, income2 = 60000.432, income3 = 45000.123, income4 = 65000.543;
+ double gpa1 = 3.334, gpa2 = 3.892, gpa3 = 2.744, gpa4 = 4.154;
+ int age = 34, age2 = 23, age3 = 37, age4 = 43;
+
+ cout <<setw(13) << "Names: " << setw(9) << "Joe" << setw(15) << "Hana" << setw(15) << "Smith" << setw(15) << "Troy" < endl;
+ cout << "Income in $: " << setw(13) << income1 << setw(14) << income2 << setw(14) << income3 << setw(16) << income4 << endl;
+ cout.setf(ios::fixed);
+ cout << setprecision(2) <<setw(13) << "GPA:" << setprecision(3) << setw(11) << gpa1 << setw(14) << gpa2 << setw(14) << gpa3 << setw(16) << gpa4 <<"\n\n" << endl;
+
+ cout << setw(13) << "Names: " << setw(9) << "Joe" << setw(15) << "Hana" << setw(15) << "Smith" << setw(15) << "Troy" << endl;
+ cout.setf(ios::fixed);
+ cout << setprecision(2) << "Income in $: " << setw(14) << income1 << setw(14) << income2 << setw(14) << income3 << setw(16) << income4 << endl;
+ cout <<setw(13) << " Age: " << setw(8) << age1 << setw(14) << age2 << setw(14) << age3 << setw(16) << age4 << endl;
+
+
+
+
+ return 0;
+}
+
+/*
+#include <iostream>
+#include <iomanip>
+#include <string>
+
+
+using std::cin;
+using std::cout;
+using std::endl;
+using namespace std;
+using std::setw;
+using std::setprecision;
+using std::ios;
+
+int main()
+{
+ string Joe, Hana, Smith, Troy;
+ float income1 = 57000.383, income2 = 60000.432, income3 = 45000.123, income4 = 65000.543;
+ double gpa1 = 3.334, gpa2 = 3.892, gpa3 = 2.744, gpa4 = 4.154;
+ int age1 = 34, age2 = 23, age3 = 37, age4 = 43;
+
+ cout <<setw(13) << "Names: " << setw(9) << "Joe" << setw(15) << "Hana" << setw(15) << "Smith" << setw(15) << "Troy" << endl;
+ cout << "Income in $: " << setw(13) << income1 << setw(14) << income2 << setw(14) << income3 << setw(16) << income4 << endl;
+ cout.setf(ios::fixed);
+ cout << setprecision(2) <<setw(13) << "GPA:" << setprecision(3) << setw(11) << gpa1 << setw(14) << gpa2 << setw(14) << gpa3 << setw(16) << gpa4 <<"\n\n" << endl;
+
+ cout << setw(13) << "Names: " << setw(9) << "Joe" << setw(15) << "Hana" << setw(15) << "Smith" << setw(15) << "Troy" << endl;
+ cout.setf(ios::fixed);
+ cout << setprecision(2) << "Income in $: " << setw(14) << income1 << setw(14) << income2 << setw(14) << income3 << setw(16) << income4 << endl;
+ cout <<setw(13) << " Age: " << setw(8) << age1 << setw(14) << age2 << setw(14) << age3 << setw(16) << age4 << endl;
+
+ return 0;
+}
+
+
+*/
+
+
+
+
+
|