Answer:
A program written in C++ was create for a customer bill for a company. the company sells five products, which are TV, DVD player, Remote Controller, CD Player, and Audio Visual Processor.
The code is implemented and shown below in the explanation section
Explanation:
<em>Solution:</em>
The C++ Code:
#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
#define taxrate 8.75
int main(){
const double upTv = 500.00;
const double upDvdPlayer = 380.00;
const double upRemoteController = 35.00;
const double upCdPlayer = 74.00;
const double upAudioVideoProcessor = 1500.00;
cout << "How many TVs were sold? ";
double ntv;
cin >> ntv;
cout << "How many DVD players were sold? ";
double ndvd;
cin >> ndvd;
cout << "How many Remote Controllers were sold? ";
double nrc;
cin >> nrc;
cout << "How many CD Players were sold? ";
double ncd;
cin >> ncd;
cout << "How many AV Processors were sold? ";
double nav;
cin >> nav;
double ptv = ntv * upTv;
double pdvd = ndvd * upDvdPlayer;
double prc = nrc * upRemoteController;
double pcd = ncd * upCdPlayer;
double pav = nav * upAudioVideoProcessor;
double tp = ptv + pdvd + prc + pcd + pav;
cout << setw(5) << left << "QTY";
cout << setw(20) << left << "Description";
cout << setw(15) << left << "Unit Price";
cout << setw(15) << left << "Price" << endl;
cout << setw(5) << left << (int)ntv;
cout << setw(20) << left << "TV";
cout << setw(15) << left << fixed << setprecision(2) << upTv;
cout << setw(15) << left << fixed << setprecision(2) << ptv << endl;
cout << setw(5) << left << (int)ndvd;
cout << setw(20) << left << "DVD";
cout << setw(15) << left << fixed << setprecision(2) << upDvdPlayer;
cout << setw(15) << left << fixed << setprecision(2) << pdvd << endl;
cout << setw(5) << left << (int)nrc;
cout << setw(20) << left << "Remote Controller";
cout << setw(15) << left << fixed << setprecision(2) << upRemoteController;
cout << setw(15) << left << fixed << setprecision(2) << prc << endl;
cout << setw(5) << left << (int)ncd;
cout << setw(20) << left << "CD Player";
cout << setw(15) << left << fixed << setprecision(2) << upCdPlayer;
cout << setw(15) << left << fixed << setprecision(2) << pcd << endl;
cout << setw(5) << left << (int)nav;
cout << setw(20) << left << "AV Processor";
cout << setw(15) << left << fixed << setprecision(2) << upAudioVideoProcessor;
cout << setw(15) << left << fixed << setprecision(2) << pav << endl;
cout << setw(15) << left << "SUBTOTAL";
cout << setw(15) << left << fixed << setprecision(2) << tp << endl;
cout << setw(15) << left << "TAX";
cout << setw(15) << left << fixed << setprecision(2) << taxrate << endl;
double ttp = tp + 0.0875 * tp;
cout << setw(15) << left << "Total";
cout << setw(15) << left << fixed << setprecision(2) << ttp << endl;
return 0;
}