i have code according to the output tht i have provided. Please help me where my mistakes are. The customer have to key in the number of person for each category. i have to use manipulators and if else.
#include<iostream>
#include <iomanip>
using namespace std;
int main()
{
int e, f, g, h;
double total, GTotal, disc, a, b, c, d;
const double a = 30.00, b = 40.00, c = 15.00, d = 0;
if (e)
(e * a);
if (f)
(f * b);
if (g)
(g * c);
if (h)
(h * d);
1 2
if (disc)
(total * 0.1);
These statements do nothing, because you are not assigning anything.
Also if (number) is equivalent to if (number != 0)
Using single-letter variable names (outside of de facto standard naming schemes like 'i' in a loop) is a bad practice. Use more descriptive names.
Other than that, clearly the sample output shows more than what you're printing. So first step would at least be printing the static text that it want you to print.