Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Please help me solving it online

–1 vote
asked Oct 7, 2019 by anonymous

Write a program in C++ that computes and displays the selling price of an item and the Net Salary of an employee based on the following constant;
VAT 16%
Payee 12%

It should display;

Enter the price of the product: 30,000
Enter Gross Salary: 50,000
Selling price of the product: 34,800
Net pay: 44,000

Can I have this code in the next one hour?

Regards,
Benson

2 Answers

0 votes
answered Oct 7, 2019 by anonymous
#include <iostream>

using namespace std;

int main()
{
    const float VAT=0.16;
    const float Payee=0.12;
    
    double P,GS;

    cout<<"Enter the price of the product:";    
    cin>>P;
    cout<<"\nEnter Gross Salary: ";
    cin>>GS;
    
    cout<<"Selling price of the product: "<<(P+P*VAT)<<endl;
    cout<<"Net pay: "<<(GS-GS*0.12)<<endl;
    
    
    system("pause");
    }
0 votes
answered Oct 9, 2019 by anonymous
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>
#include <iomanip>
#include <locale>

using namespace std;
const double VAT = 16.0/100;
const double PAYEE = 12.0/100;

int main()
{
    cout<<"Start of the program";
    
    double price, salary;
    double sell_price, net_pay;
    cout << "Enter the price of the product:";
    cin >> price;
    cout << "Enter Gross Salary:";
    cin >> salary;

    // thousand seperator
    std::cout.imbue(std::locale(""));

    sell_price = price + (price * VAT);
    cout << "The price is " << setprecision(9) << sell_price << std::endl;
    
    net_pay = salary - (salary * PAYEE);
    cout << "Net pay:" << net_pay;

    return 0;
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...