24 lines
470 B
C++
24 lines
470 B
C++
|
#include <iostream>
|
||
|
#include <iomanip>
|
||
|
#include <math.h>
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
int numPizza;
|
||
|
double subTotal;
|
||
|
double totalDue;
|
||
|
|
||
|
/* Type your code here */
|
||
|
double const cost = 9.99;
|
||
|
double const salesTax = 1.06;
|
||
|
cin >> numPizza;
|
||
|
|
||
|
subTotal = cost * numPizza;
|
||
|
totalDue = subTotal * salesTax;
|
||
|
|
||
|
cout << "Subtotal: $" << fixed << setprecision(2) << subTotal << endl;
|
||
|
cout << "Total due: $" << fixed << setprecision(2) << totalDue << endl;
|
||
|
|
||
|
return 0;
|
||
|
}
|