#include <iostream>
#include <iomanip>
using namespace std;
int main(){
float price;
float finalPrice=0;
for(int i=0;i<3;i++){
cout<<"Enter item price: ";
cin>>price;
finalPrice=price;
if(price>100){
finalPrice=price-price*0.05;
}
cout<<fixed<<"Price of item: R"<<setprecision(2)<<price<<"\n";
cout<<"Final price of item: R"<<setprecision(2)<<finalPrice<<"\n";
system("pause");
}
return 0;
}
Comments
Leave a comment