Adding up the bag and accessories

Hi guys,

I made a script that is supposed to let you choose between the bag and the accessories. It works but not the way I want it to work.I want it to let the customer choose the bag and the accessories and to add up the total in the end. For some reason it only lets me choose how many items, but only lets me choose the first item. I wanted to have it choose the first handbag then choose the accessories, then the total.
Thank you in advance:

This is the script:
#include <iostream>
using namespace std;

double total_cost(int number_par, double price_par);

int main()
{
double price, bill;
int number;
cout << "Hi customer, please choose between the four types of handbags:\n";
cout << "A:Fendi for $4,250.99\n";
cout << "B:Valentino for $4,145\n";
cout << "C:Michael Kors for $2300.95\n";
cout << "D:Saint Laurent for $2,290.00\n";
cout << "Enter the number of items purchased:\n";

cout << "\nThank you for choosing the handbag , please choose between the three types of accessories:\n";
cout << "E:Bag tassel $130.45\n";
cout << "F:Bag patches $126.29\n";
cout << "G:Feather Bag Charm $95.55.\n";
cin >> number;
cout << "Enter the price per item $\n";
cin >> price;

bill = total_cost(number, price);


cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout << number << " items at "
<< "$" << price << " each.\n "
<< "Final bill, including tax, is $" << bill
<< endl;

return 0;
}

double total_cost(int number_par, double price_par)
{
const double TAX_RATE = 9.75;
double subtotal;

subtotal = price_par * number_par;
return (subtotal + subtotal * TAX_RATE);
}
You should be using a for loop to count a number of items and their price.
Thank you SakurasouBusters
Topic archived. No new replies allowed.