| |
at the store:
Check if amount is enough
#include "franca.h"
void mainprog()
{
- float price,amount,change;
- float tax=0.08;
- amount=ask("Enter the amount:");
- price=ask("Enter the price")*(1+tax);
- if(amount<price)
- {
- Clock time;
- Cout<<"This is not enough!";
- time.wait(5);
- }
- change=amount-price;
- Cout<<change;
}
|