OneCompiler

How can i modify the code

184

#include <iostream>
#include<iomanip>
using namespace std;

int main()
{
string itemCode;
double unitPrice, subtotal=0, grandtotal=0;
int quantity;

cout << "Enter the Item Code" << endl;
cin >> itemCode;
cout << "Enter the Item Price" << endl;
cin >> unitPrice;
do{
    cout << "Enter the Quantity" << endl;
cin >> quantity;
} while (quantity >= 4);
subtotal = unitPrice * quantity;
grandtotal += subtotal;
 cout << setw(15) << "Item Code" << setw(15) << "Unit Price" << setw(10) << "Quantity" << setw(15)

<< "Subtotal" << endl;
cout << setw(15)<< itemCode << setw(15) << unitPrice << setw(10)<<quantity<<setw(10)<<subtotal<<endl;
cout << setw(40) << "Grand Total:" << setw(15) << grandtotal << endl;
return 0;
}