### Data strucuture c++ exercise

I have to do this:
Information on the sale and purchase of a company will be saved in a data structure.
Struct consists of the name of the shopping company, the shopping type (buy or sell),
the amount of shopping, date of shopping and shopping description (like discount).
1. Define the data structure to keep the information about 1000 companies.
2. This data structure was assumed that the necessary information has been entered in
advance, please write the function that calculate how much the sale and purchase of the
company are. (do not write main() functionâ€¦)

and I have this code but it do not work. What is/are the problem/s?
#include <iostream>
#include <cstring>
#include <conio.h>

#define n_shop 1000

struct Date
{
int day;
int month;
int year;
};
struct Company
{
char shop[50];
char bos;
float amount;
Date d_shopping;
int disc;
}name[n_shop];

float calculate (company total)
{
int h=0;
int i;
for (i=0; i<n_shop; i++)
{
if(name[i].BoS=='b')
total=total - name[i].amount + (name[i].amount*(name[i].discount/100));
if(name[i].BoS=='s')
total=total + name[i].amount - (name[i].amount*(name[i].discount/100));

}
return (total);
}

Hello.

I assume those are the whole code you have in your file.

 ``123456789101112131415161718192021222324252627282930313233343536373839404142`` `````` // Where is main? #include // why do you need this? #include // why do you need this? #include // why do you need this? #define n_shop 1000 struct Date { int day; int month; int year; }; struct Company { char shop[50]; char bos; float amount; Date d_shopping; int disc; }name[n_shop]; float calculate (company total) // Is it "C"ompany? { int h=0; int i; for (i=0; i

It is ok now? How can I improve it for the program do that exercise says?

#define n_shop 1000

struct Date
{
int day;
int month;
int year;
};
struct Company
{
char shop[50];
char bos;
float amount;
Date d_shopping;
int disc;
}name[n_shop];

float calculate (Company total)
{
int i;
for (i=0; i<n_shop; i++)
{
if(name[i].bos=='b')
total=total - name[i].amount + (name[i].amount*(name[i].disc/100));
if(name[i].bos=='s')
total=total + name[i].amount - (name[i].amount*(name[i].disc/100));

}