diff options
| author | BensProgramma <[email protected]> | 2021-10-12 17:57:50 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-12 17:57:50 -0700 |
| commit | dd7c07fa52129eed94a157918b5dac1773b30a7d (patch) | |
| tree | ab35b4fe6824fe257dfc1c1511003460598126ec /5.10_1_Schroeder.cpp | |
| parent | Lab2_5.4_1_Schroeder (diff) | |
| download | cst116-lab2-bensprogramma-dd7c07fa52129eed94a157918b5dac1773b30a7d.tar.xz cst116-lab2-bensprogramma-dd7c07fa52129eed94a157918b5dac1773b30a7d.zip | |
Add files via upload
Diffstat (limited to '5.10_1_Schroeder.cpp')
| -rw-r--r-- | 5.10_1_Schroeder.cpp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/5.10_1_Schroeder.cpp b/5.10_1_Schroeder.cpp new file mode 100644 index 0000000..67ccf5d --- /dev/null +++ b/5.10_1_Schroeder.cpp @@ -0,0 +1,70 @@ +//********************************************************************
+//* File: Chapter 5 PE 5_1.cpp
+//* Have fun with these errors!
+//********************************************************************
+#include <iostream>
+#include <iomanip>
+using std::cout;
+using std::cin;
+using namespace std;
+using std::setprecision;
+using std::ios;
+
+int main()
+{
+ double ProductionHours,
+ PreProductionHours,
+ ProducersHours,
+ ProductionCost,
+ PreProductionCost,
+ ProducersCost,
+ TotalCost,
+ ProductionRATE,
+ PreproductionRATE,
+ ProducersRATE;
+
+ cout << "\nEnter Production Hours: ";
+ cin >> ProductionHours;
+ cout << "Enter Production Rate: $";
+ cin >> ProductionRATE;
+ cout << "\nEnter Pre-Production Hours: ";
+ cin >> PreProductionHours;
+ cout << "Enter Pre-production Rate: $";
+ cin >> PreproductionRATE;
+ cout << "\nEnter Producer Hours: ";
+ cin >> ProducersHours;
+ cout << "Enter Producers Rate: $";
+ cin >> ProducersRATE;
+
+ ProductionCost = ProductionHours * ProductionRATE;
+ PreProductionCost = PreProductionHours * PreproductionRATE;
+ ProducersCost = ProducersHours * ProducersRATE;
+
+ TotalCost = ProductionCost + PreProductionCost + ProducersCost;
+
+ cout << "\n\t Car Dealership Bill \n";
+ cout << "\n\nProduction Cost: $";
+ cout.setf(ios::fixed);
+ cout << setprecision(2);
+ cout << ProductionCost;
+
+ cout << "\n\nPre-Production Cost: $";
+ cout.setf(ios::fixed);
+ cout << setprecision(2);
+ cout << PreProductionCost;
+
+ cout << "\n\nProducers Cost: $";
+ cout.setf(ios::fixed);
+ cout << setprecision(2);
+ cout << ProducersCost;
+
+ cout << "\n\nWeekly Total Cost: $";
+ cout.setf(ios::fixed);
+ cout << setprecision(2);
+ cout << TotalCost;
+ cout << "\n\n";
+
+ return 0;
+
+}
+
|