Required:* 1. First 3 lines of code will be three comment lines Name of the cpp
ID: 3918901 • Letter: R
Question
Required:* 1. First 3 lines of code will be three comment lines Name of the cpp file- Your name+ Why you are doing this program- Summary of the program on the screenv 3. Input Enter in the number of sales items* Enter in the name of the sales item - Enter in the price of the sales item 4. Output* Title for the output- - The sales items names The price of each sales ite The sales price total- The sales tax The grand total ms ount have 2 decimal point places oney amount to be alignedv Boarder around the output 5. The user will have the ability to run this program again. Fig. 1 is an example of the input screen.+ "C:DatalPSUNCoursesFall 061CMPSC 101 Un-class Pfiles Chapter 9,10Deb-D lcone to the new and approved Sales Receipt systen his new system ill not only calculate nultiple sales itens It wil1 also store the nane of the sales iten En.joy the new systen!?!! ter in the nunber of sales itens to be calculated3 ter in the nane of sales iten nunber 1 Books nter in the price of the Books: $45.67 Pens ter in the nane of sales iten nunber 2 ter in the price of the Pens $3.23 nter in the nane of sales iten nunber 3 Laptop ter in the price of the Laptop $2800.00 Fig. 1vExplanation / Answer
#include<iostream>
using namespace std;
int main()
{
// name of the file is sales.cpp
// my name is george
// for improving my coding skills
cout << "Welcome to the new and approved sales reciept system. This new system will
not only calculate multiple sales items.";
cout <<"It will also store the name of the sales item. Enjoy the new system";
cout<<" Enter the number of sales items to be calculated : ";
int n,i;
float sales_total=0.00,sales_tax=122.93;
cin >> n;
cout<<" ";
char items[n][100];
float prices[n];
for(i=0;i<n;i++)
{
cout <<"Enter the name of sales item number ";
cout <<(i+1);cout << " : ";
cin >> items[i];
cout << "Enter the price of the ";
cout << items[i];
cout << " : $ ";
cin >> prices[i];
}
cout<<"************************************************************************** ";
cout<<"************************************************************************** ";
cout<<"*************************** SALES RECEIPT ************************** ";
cout<<"************************************************************************** ";
cout <<"** ** ** ** ";
cout <<"** Items Name ** ** Price ** ";
cout<<"************************************************************************** ";
for(i=0;i<n;i++)
{
cout <<"** ";
cout << items[i];
cout <<" $ ";
cout <<prices[i];
cout <<" **";
cout<<" ";
sales_total=sales_total+prices[i];
}
cout<<"************************************************************************** ";
cout <<"** ";
cout << "Sales Total";
cout <<" $ ";
cout <<sales_total;
cout <<" **";
cout<<" ";
cout <<"** ";
cout << "Sales Tax";
cout <<" $ ";
cout <<sales_tax;
cout <<" **";
cout<<" ";
cout <<"** ------------------------** ";
cout <<"** ";
cout << "Grand Total";
cout <<" $ ";
cout <<sales_tax+sales_total;
cout <<" **";
cout<<" ";
cout <<"** ** ";
cout<<"************************************************************************** ";
cout<<"************************************************************************** ";
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.