Create a C++ Program that will identify the Discount Rate of a shopper based on issued loyalty card, take the following conditions:
Loyalty Card TypeDiscount (%)(1) Frequent Buyer10%(2) One Time Buyer0%(3) Senior Citizen15%
This should be the outcome if ever we run the program
Example:
Total Purchase Cost: Php 3000.00
Loyalty Card Type: 1
Discounted Cost: Php 2700.00
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
double decimalPart;
string result;
int Loyalty;
cout<<"Total Purchase Cost: Php ";
cin >> decimalPart;
cout<<"Loyalty Card Type: ";
cin >> Loyalty;
if (Loyalty == 1) {
cout << "Discounted Cost: Php " << decimalPart*0.9 << endl;
}
else if (Loyalty == 2) {
cout << "Discounted Cost: Php " << decimalPart << endl;
}
else {
cout << "Discounted Cost: Php " << decimalPart*0.85 << endl;
}
return 0;
}
Comments
Leave a comment