PDA

View Full Version : Help.. C++


Evil...
03-02-04, 09:04 PM
How do I get this show show the total sales price after the discount has been acknowledge?

For example. price = 100 , discount = 25 , sale price = 75

#include <iostream>
using namespace std;

int main()
{

float original = 0.0;
float rate = 0.0;

float discount = 0.0;

float sale = 0.0;

cout << "Original prices:";
cin >> original;
cout << "Discount rate: ";
cin >> rate;

discount = original * rate;

sale = discount - original;

cout << "sales price:" <<sale <<endl;

return 0;
}

clay@lazarusid.com
03-06-04, 10:36 AM
You just need to output the other data as well and everything will be fine.