From 9d53d8857eaa1c9405894a88ca75bc4657e42f35 Mon Sep 17 00:00:00 2001 From: msglm Date: Sat, 14 Jan 2023 05:31:48 -0600 Subject: Inital Commit --- .../Summer Job Program - planning sheet.docx | Bin 0 -> 40013 bytes .../Summer Job Program - planning sheet.odt | Bin 0 -> 41323 bytes .../Summer Job Program - planning sheet.pdf | Bin 0 -> 93477 bytes C++/SummerJob/SummerJob.cpp | 56 +++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 C++/SummerJob/Summer Job Program - planning sheet.docx create mode 100644 C++/SummerJob/Summer Job Program - planning sheet.odt create mode 100644 C++/SummerJob/Summer Job Program - planning sheet.pdf create mode 100644 C++/SummerJob/SummerJob.cpp (limited to 'C++/SummerJob') diff --git a/C++/SummerJob/Summer Job Program - planning sheet.docx b/C++/SummerJob/Summer Job Program - planning sheet.docx new file mode 100644 index 0000000..06ec803 Binary files /dev/null and b/C++/SummerJob/Summer Job Program - planning sheet.docx differ diff --git a/C++/SummerJob/Summer Job Program - planning sheet.odt b/C++/SummerJob/Summer Job Program - planning sheet.odt new file mode 100644 index 0000000..787eb0d Binary files /dev/null and b/C++/SummerJob/Summer Job Program - planning sheet.odt differ diff --git a/C++/SummerJob/Summer Job Program - planning sheet.pdf b/C++/SummerJob/Summer Job Program - planning sheet.pdf new file mode 100644 index 0000000..13ce8b6 Binary files /dev/null and b/C++/SummerJob/Summer Job Program - planning sheet.pdf differ 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 +#include +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 . + */ + -- cgit v1.2.3