0
cout <<endl<< "Game" << setw(15) << "Price" << setw(15) << "Discount" << setw(21) << "DiscountPrice" << setw(15) << "Action" << endl;
for (j = 0; j < 5; j++)
{
    cout << games[j].gname << setw(10) << games[j].gprice << setw(10) <<games[j].discountprc<< "%" << setw(10)<<games[j].gprice-(games[j].gprice)*(games[j].discountprc)/100;
}

the output should be

Game          Price       Discount     Discountprice     Action
Stealth         144            75%                36     Buy
..
..
..

Game name and advised action columns should be aligned to left. Price, discount percentage and discounted price columns should be aligned to right.

JuanDoe
  • 68
  • 7

0 Answers0