summaryrefslogtreecommitdiffstats
path: root/C++/SummerJob/SummerJob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'C++/SummerJob/SummerJob.cpp')
-rw-r--r--C++/SummerJob/SummerJob.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/C++/SummerJob/SummerJob.cpp b/C++/SummerJob/SummerJob.cpp
new file mode 100644
index 0000000..e8459d5
--- /dev/null
+++ b/C++/SummerJob/SummerJob.cpp
@@ -0,0 +1,56 @@
+// Name: msglm
+// Introduction: Summer Job Wage Calculator
+// Description: a program that calculates a weekly wage, based on an hourly payrate and how many hours were worked; then calculates amounts for various categories of spending, along with how much of the weekly pay is leftover.
+
+
+#include <iostream>
+#include <string>
+using namespace std;
+int main() {
+
+ string name;
+ float payRate;
+ float hours;
+ float WeeklyWage;
+
+ //Accept input via cin for hourly wages, pay rate, and name
+
+ cout << "What is your name?: ";
+ getline(cin, name);
+
+ cout << "What is your payrate (per hour)?: ";
+ cin >> payRate;
+
+ cout << "How many hours have you worked?: ";
+ cin >> hours;
+
+ //Multiply the input to create the WeeklyWage variable
+ //Possible memory optimization here by removing the WeeklyWage variable, but at the cost of CPU cycles.
+ WeeklyWage = hours*payRate;
+
+ //Print the User’s name
+ cout << "Name: " << name << endl;
+
+
+ //Print the Wage
+ cout << "Wages: " << WeeklyWage << "$" << endl;
+
+ //have a bunch of cout statements that do all the math
+ // I.e : cout << “Tax: “ << WeeklyWage*0.15
+
+ cout << "Tax: $" << WeeklyWage*0.15 << endl;
+ cout << "Shopping: $" << WeeklyWage*0.20 << endl;
+ cout << "Entertainment: $" << WeeklyWage*0.10 << endl;
+ cout << "Savings: $" << WeeklyWage*0.25 << endl;
+ cout << "Remainder: $" << WeeklyWage*0.30 << endl;
+
+ return 0;
+
+}
+
+/*This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+