Draw a flowchart, write an algorithm and design a C++ program for a store owner who wants to give 10% discount to the purchases made by customers who are at least 65 years old. Use the selection structure.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int age, price;
cout<<"Enter the Amount:";
cin>>price;
cout<<"Enter your Age:";
cin>>age;
if (age >= 65)
{
price = price - (price * 0.1);
cout<<"Your Total Amount is: "<<price<<endl;
}
else{
cout<<"Your Total Amount is: "<<price<<endl;
}
return 0;
}
Comments
Leave a comment