Question: Please help me with this c program. this is without the function prototypes. typedef struct { char OrderName [ 5 0 ] ; / /

Please help me with this c program.
this is without the function prototypes.
typedef struct {
char OrderName[50]; //stores the first name of the customer
int OrderNumber; //stores the order number of the customer
double OrderAmount; //stores the order amount
char location[100]; //stores the customers location
char validOrder;//stores 'V' for valid or 'I' invalid
} customer;
int main()
{
//declare character for the choice
char choice;
//declare an array of 50 customers (inventory )
customer inventory[50];
//declare count for the array
count =0;
//greet the user
//fill five customers into the array
//set count to 5
printf("
FIVE Valid customers have been added to the inventory.
");
//get the choice - initialization
//while (choice !='Q')//test
{
//ProcessMenu(choice, inventory, &count);
//choice = GetChoice(); //update
}
printf("
Have a great day!");
return 0;
}
//(1)greet the user
//(2)fill the inventory with five customers
void FillFive(customer inventory[])
{
customer temp1={ "Iron.Man", 1,23567843567.99, "Malibu", 'V'};
inventory[0]= temp1;
//add 4 more
}
//(3)Display the menu, ask, get, and return the user choice
//(4)run the program menu (process the choice)
//use if else conditions (or switch)
void ProcessMenu(char choice, customer inventory[], int* countPtr)
{
if (choice =='A')
{
//add customer to list
//add one to count
*countPtr =*countPtr +1;
}
else if (choice =='P')
{
printf("
There are %d orders
",*countPtr);
//declare ask and get the order number
int number;
//use a loop to make sure the user enters a valid order number
//PrintOneCustomer(inventory[num -1]);
}
else if (choice =='V')
{
//call the print valid inventory function
}
else if (choice =='C')
{
printf("Creating a report");
//call print file function
}
else if (choice =='I')
{
//call make invalid function
}
else if (choice =='E')
{
double amount;
//ask and get the amount
//loop through the array to display
}
else if (choice =='T')
{
//calculate the total and the average
}
else printf("
Not valid");
}
//(5)print ONE customer information onto the screen
void PrintOneCustomer(customer info)
{
printf("
---------------------------------------
");
printf("
Order number:\t\t%d", info.OrderNumber);
//add the rest
}
//(6)print entire VALID customer inventory onto the screen
void PrintValidList(customer inventory[], int count)
{
int i;
for (i =0; i count; i++)
{
if (inventory[i].validOrder =='V')
{
//only print valid orders
}
}
}
//(7)print entire customer inventory(valid and invalid) into a file
void PrintListToFile(customer inventory[], int count)
{
FILE* outPtr;
outPtr = fopen("report.txt","w");
int i;
for (i =0; i count; i++)
{
fprintf(outPtr,"
---------------------------------------
");
fprintf(outPtr,"
Order number:\t\t%d", inventory[i].OrderNumber);
//add the rest
}
fclose(outPtr);
}
//(8)Add a new customer into the inventory
void AddCustomerToList(customer inventory[], int count)
{
//set the oder number based on the count
inventory[count].OrderNumber = count +1;
//get the name
printf("Please enter the name of the order: ");
scanf("%s", inventory[count].OrderName);
//add the additional prompts and scanf statements
//set the order as valid
inventory[count].validOrder ='V';
}
//(9)make a customer invalid
void MakeInvalid(customer inventory[], int count)
{
printf("
There are %d orders
", count);
//declare ask and get the order number
int number;
//use a loop to make sure the user enters a valid order number
//inventory[number -1].validOrder ='I';
//order number is one greater than the index, examples:
//index is 0- order number is 1
//inedx is 1- order number is 2
}
//(10) Calculate the total and the average of all the valid orders
void CalculateTotalAverage(customer inventory[], int count)
{
int i, totalCount =0;
double sum =0.0, avg;
//loop through the array to add up all the amounts that are valid
//be sure to keep a total count for the average
}
Please help me with this c program. this is

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!