Im using xcode to write my program. Every time I build and run the program it will do everything fine, until the end. It keeps giving me an answer of 0 no matter what i put. Need help to figure out what im doing wrong thanks in advance.
//price_converter
#include <iostream>
#include <string>
#include <cmath>;
using namespace std;
int main()
{
float price, total, tax;
int quantity;
string product;
tax = .0875;
total = price * quantity * tax;
cout << "what are you buying?\n";
cin >> product;
cout << "how much does it cost?\n";
cin >> price;
cout << "how many are you buying?\n";
cin >> quantity;
if(quantity <= 0)
{
cout << "you have to buy something";
return 0;
}
cout << "your total for your\n" << product << " is\n" << total;
return 0;
}