#include <iostream>
using namespace std;
const float Bill_Amount = 1200; // Amount of Bill
const double Price = 120; // Value of Discount
const string Electronics = "1"; // First type of products
const string Food = "2"; // Second type of products
const string Others = "3"; // Third type of products
int main ()
{
float x1, x2, x3;
cout<< "Please enter number of types of products"<<endl;
cin>> x1, x2, x3;
double NewPrice = 0;
Read the assignment again. Look at the inputs. You aren't asking the user for the inputs required. You are supposed to input the product type and the bill amount.
Also, you're combining the calculation of the new price with the output. To make a clean algorithm, do these separately. In other words, the basic algorithm should be:
- prompt the user for the product type and bill amount.
- compute the discount amount.
- display the output.
Make sure that when you run the program with the inputs in the example, you get exactly the outputs in the example. Following the specifications exactly is an absolutely essential part of programming.