Someone helped me and code this progeam but still my professor says There is nothing in your code indicating that the reward points will display with fixed point notation with no decimal places .Please help me to fix it
Here is code:
#include #include using namespace std; //Function prototypes void standard(double purchaseAmt); void plusMemberShip(double purchaseAmt); void premium(double purchaseAmt); //Program begins with a main function int main() { //Declare variables char membershipType; double purchaseAmt = 0.0; //Prompt and read the membership type cout << "Membership types: " << endl; cout << " Standard = S " << endl; cout << " Plus = P " << endl; cout << " Premium = R " << endl; cout << "Enter membership type(S/P/R): "; cin >> membershipType; //Prompt and read the total monthly purchase amount cout << "Enter total monthly purchase amount: "; cin >> purchaseAmt; // fixed point notation with no decimal places cout << std::fixed; cout << std::setprecision(0); // zero means no decimal places if (membershipType == 'S' || membershipType == 's') { //function calls standard(purchaseAmt); } else if (membershipType == 'P' || membershipType == 'p') { plusMemberShip(purchaseAmt); } else if (membershipType == 'R' || membershipType == 'r') { premium(purchaseAmt); } else cout << " Invalid member ship type" << endl; cout << endl; //Pause the system for a while system("pause"); return 0; } double rewardPoints = 0; //Method definition of standard void standard(double purchaseAmt) { if (purchaseAmt < 75) rewardPoints = 0.05 * purchaseAmt; else if (purchaseAmt >= 75 && purchaseAmt <= 149.99) rewardPoints = 0.075 * purchaseAmt; else (purchaseAmt >= 150); rewardPoints = 0.10 * purchaseAmt; cout << " Reward points in Standard membership: " << rewardPoints << endl; } //Method definition of plusMemberShip void plusMemberShip(double purchaseAmt) { if (purchaseAmt < 150) rewardPoints = 0.06 * purchaseAmt; else rewardPoints = 0.13 * purchaseAmt; cout << " Reward points in plus membership: " << rewardPoints << endl; } //Method definition of premium void premium(double purchaseAmt) { if (purchaseAmt < 200) rewardPoints = 0.04 * purchaseAmt; else rewardPoints = 0.15 * purchaseAmt; cout << " Reward points in premium membership: " << rewardPoints << endl; }