#include <iostream>
#include <string>
#include <cstdlib>//General Utilities Library for general function purposes
usingnamespace std;
//Void Function for Week 2
void greeting()
{
cout << "Welcome to Golf Ballz Inc! \n";
}
int main()
{
//declaring variables
string Name, Address;
char response;
//greeting, name and address gathering
greeting();
cout << "Please enter your name: \n";
getline(cin, Name);
cout << "Pleae enter your shipping address: \n\n";
getline(cin, Address);
string * pName, *pAddress; //Pointers
//verifying address
cout << "Welcome " << pName << "!" << endl << endl;
cout << "You entered your shipping address as: " << pAddress << endl << endl;
pName = &Name; //Pointer to reference Name entered
pAddress = &Address; // pointer to reference Address entered
//list of products
cout << "Here is a list of available products we offer: \n";
cout << "Mens Golf Ballz \n Come in a variety of hardness and spin control options to rival the Pro's on tour! \n";
cout << "Womens Golf ballz \n Geared toward our beautiful golf girlz on the course! \n";
cout << "Kids Golf Ballz \n Offered in a variety of fun colors and designs! \n\n";
cout << " Each golfer can choose from a variety of colors and designs. \n\n";
string PRODUCT[3] = { "Men's Golf Ballz", "Women's Golf Ballz", "Kids Golf Ballz" };
int QUANT[3];
double PRICE[3] = { 23.00, 20.00, 15.00 }; //String with Prices of products pre-determined
cout << "Product #1 - Men's Golf Ballz are $23.00/dozen" << endl;
cout << "Product #2 - Women's Golf Ballz are $20.00/dozen" << endl;
cout << "Product #3 - Kid's Golf Ballz are $15.00/dozen" << endl;
double total = 0;//inistialize total to zero
for (int counter = 0; counter < 3; counter++)
{
cout << "Enter quantity for Product # " << counter + 1 << ": ";
cin >> QUANT[counter];// customer enters quantities under each product type
total += QUANT[counter] * PRICE[counter];//equation to give final total of all products
}
cout << "Your total bill is : $" << total << endl; //final statement that gives total bill due
cout << "Are you finished shopping? (Y/N)";
cin >> response;
system("PAUSE");
return 0;
}