aboutsummaryrefslogtreecommitdiff
path: root/4b/5.10Programming/5.10Programming.cpp
diff options
context:
space:
mode:
Diffstat (limited to '4b/5.10Programming/5.10Programming.cpp')
-rw-r--r--4b/5.10Programming/5.10Programming.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/4b/5.10Programming/5.10Programming.cpp b/4b/5.10Programming/5.10Programming.cpp
new file mode 100644
index 0000000..c12988a
--- /dev/null
+++ b/4b/5.10Programming/5.10Programming.cpp
@@ -0,0 +1,51 @@
+//********************************************************************
+//* File: Chapter 5 PE 5_1.cpp
+//* Have fun with these errors!
+//********************************************************************/
+#include <iostream>
+using std::cout;
+using std::cin;
+
+int main()
+{
+ const double PRODUCTION_RATE = 1.15,
+ PRE_PRODUCTION_RATE = 1.4,
+ PRODUCERS_RATE = 1.25;
+
+ double ProductionHours,
+ PreProductionHours,
+ ProducersHours,
+ ProductionCost,
+ PreProductionCost,
+ ProducersCost,
+ TotalCost;
+
+ cout << "Enter Production Hours: ";
+ cin >> ProductionHours;
+ cout << "\nEnter Pre-Production Hours: ";
+ cin >> PreProductionHours;
+
+ cout << "\nEnter Producers Hours: ";
+ cin >> ProducersHours;
+
+ ProductionCost = ProductionHours * PRODUCTION_RATE;
+ PreProductionCost = PreProductionHours * PRE_PRODUCTION_RATE;
+ ProducersCost = ProducersHours * PRODUCERS_RATE;
+
+ TotalCost = ProductionCost + PreProductionCost + ProducersCost;
+
+ cout << "\n\t\tCar Dealership Bill\n";
+ cout << "\n\nProduction Cost: ";
+ cout << ProductionCost ;
+
+ cout << "\n\nPre-Production Cost: ";
+ cout << PreProductionCost;
+
+ cout << "\n\nProducers Cost: ";
+ cout << ProducersCost;
+
+ cout << "\n\nWeekly Total Cost: ";
+ cout << TotalCost << std::endl;
+
+ return 0;
+}