diff options
author | msglm <msglm@techchud.xyz> | 2023-01-14 05:31:48 -0600 |
---|---|---|
committer | msglm <msglm@techchud.xyz> | 2023-01-14 05:31:48 -0600 |
commit | 9d53d8857eaa1c9405894a88ca75bc4657e42f35 (patch) | |
tree | eb1efc1d028b949dd83bb710c68be8eff58f26e7 /C++/SummerJob | |
download | school-code-master.tar.gz school-code-master.tar.bz2 school-code-master.zip |
Diffstat (limited to 'C++/SummerJob')
-rw-r--r-- | C++/SummerJob/Summer Job Program - planning sheet.docx | bin | 0 -> 40013 bytes | |||
-rw-r--r-- | C++/SummerJob/Summer Job Program - planning sheet.odt | bin | 0 -> 41323 bytes | |||
-rw-r--r-- | C++/SummerJob/Summer Job Program - planning sheet.pdf | bin | 0 -> 93477 bytes | |||
-rw-r--r-- | C++/SummerJob/SummerJob.cpp | 56 |
4 files changed, 56 insertions, 0 deletions
diff --git a/C++/SummerJob/Summer Job Program - planning sheet.docx b/C++/SummerJob/Summer Job Program - planning sheet.docx Binary files differnew file mode 100644 index 0000000..06ec803 --- /dev/null +++ b/C++/SummerJob/Summer Job Program - planning sheet.docx diff --git a/C++/SummerJob/Summer Job Program - planning sheet.odt b/C++/SummerJob/Summer Job Program - planning sheet.odt Binary files differnew file mode 100644 index 0000000..787eb0d --- /dev/null +++ b/C++/SummerJob/Summer Job Program - planning sheet.odt diff --git a/C++/SummerJob/Summer Job Program - planning sheet.pdf b/C++/SummerJob/Summer Job Program - planning sheet.pdf Binary files differnew file mode 100644 index 0000000..13ce8b6 --- /dev/null +++ b/C++/SummerJob/Summer Job Program - planning sheet.pdf 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/>. + */ + |