Hi I have been trying to get this code for about a week now its due shortly and I still can't get it. The instructions are to
1.Write a structure definition Sneakers that records a one character code fot the manufacture (N for Nike, R for Reebock, ect), an interger product code and the price of the pair of sneakers.
2. A funtion to enter data.
3. A fuction that calculates a sale price that has a 10% discount on the current price.
4. A function that passes the array of sneakers as an array parameter and displays all information about each pair of sneakers.
5. a.)write the main program which declares inventory as an array of sneakers of an arbitrary size.
b.)write a look that allows the stock clerk to enter info for as long as they want.
c.)For each item in the inventory call the Discount fuction to calculate the sale price.
d.)Add a switch statement that will translate the single letter code for the company to full name of output.
e.)write the final inventory with original price and sale price to a text file in the form of a chart.
Here is what I have so far:
#include<iostream>
using namespace std;
struct sneakers
{
char letter;
int code;
double price;
};
void GetInfo(sneakers info[]);//Get info from keyboard
double saleprice(double price);//Calculate discounted price
int main()
{
sneakers inventory [100];
double sales,price,sale;
GetInfo(inventory);
sales=saleprice(price);
cout<<"The sale price of the sneaker is "<<sale<<" ";
char wait;
cout<<"Hit any key to end.";
cin>>wait;
void GetInfo(sneakers info[])
{
int i=0;
char contin='y';
while (contin=='y'||contin=='Y')
{
cout<<"Enter letter for manufacture";
cin>>info[i].letter;
cout<<"Enter product code";
cin>>info[i].code;
cout<<"Enter sneaker price";
cin>>info[i].price;
cout<<"Do you want to continue (y/n)";
cin>>contin;
i++;//I know I need to count the i's to see how large the size of array is but I don't know how to do that either.
}
return;
}
double saleprice(double price)
{
double sale;
sale=price-.10*price;
return sale;
}
Please help!!!!!!!!!!!!!!!!!!!!!!!!!!