first semester files
This commit is contained in:
28
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#1/Homework01-1ASharpe.cpp
Executable file
28
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#1/Homework01-1ASharpe.cpp
Executable file
@@ -0,0 +1,28 @@
|
||||
/***************************************************************
|
||||
* Name: Aidan Sharpe
|
||||
* Course: Computer Science & Programming
|
||||
* Class: CS04103 Section: 6
|
||||
* Assignment Date: 9/22/2021
|
||||
* File Name: Homework1-1ASharpe.cpp
|
||||
*****************************************************************
|
||||
* ID: Homework 1 Problem 1
|
||||
* Purpose: Estimate the revenue generated by a specific division of a corporation.
|
||||
*****************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
const float PERCENT_TOTAL_SALES = .58;
|
||||
const int SALES = 86000000;
|
||||
|
||||
float divisionRevenue = PERCENT_TOTAL_SALES * SALES; // calculate the revenue estimate for the east coast division
|
||||
|
||||
cout << fixed << setprecision(2) << "The East Coast Division generated $" << divisionRevenue << " in sales";
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#1/Homework01-1ASharpe.exe
Executable file
BIN
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#1/Homework01-1ASharpe.exe
Executable file
Binary file not shown.
39
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#1/Homework01-2ASharpe.cpp
Executable file
39
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#1/Homework01-2ASharpe.cpp
Executable file
@@ -0,0 +1,39 @@
|
||||
/***************************************************************
|
||||
* Name: Aidan Sharpe
|
||||
* Course: Computer Science & Programming
|
||||
* Class: CS04103 Section: 6
|
||||
* Assignment Date: <date>
|
||||
* File Name: <filename>.cpp
|
||||
*****************************************************************
|
||||
* ID: Homework 1 Problem 2
|
||||
* Purpose: Calculate the tax and total cost of a purchase given sales tax and the subtotal
|
||||
*****************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
const float STATE_SALES_TAX = .065, COUNTY_SALES_TAX = 0.02;
|
||||
|
||||
float subtotal, tax, total;
|
||||
|
||||
// get price of purchase
|
||||
cout << "Price of purchase: ";
|
||||
cin >> subtotal;
|
||||
|
||||
tax = subtotal * (STATE_SALES_TAX + COUNTY_SALES_TAX); // calculate tax
|
||||
total = subtotal + tax; // calculate total price
|
||||
|
||||
cout << fixed << setprecision(3) << endl; // format the costs to 3 decimal places to account for sales tax precision errors
|
||||
|
||||
// print data
|
||||
cout << "Subtotal: $" << subtotal << endl;
|
||||
cout << "Tax: $" << tax << endl;
|
||||
cout << "Total: $" << total;
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#1/Homework01-2ASharpe.exe
Executable file
BIN
1st-Semester-Fall-2021/CSNP/CSNP-04103-Homework-#1/Homework01-2ASharpe.exe
Executable file
Binary file not shown.
Reference in New Issue
Block a user