|
Which libraries are we allowed to use? |
Any library you can "#include", and works on the t2 with the given compilation commands.
|
What should we return when there are two or more suitable error codes? |
As in the order mentioned in the pdf file .
For example in the function orangeAddFoodCompany, if there is no more place for companies and also the company we are trying to add already exists in the orange's array then we will return the error :
ORANGE_NO_PLACE_FOR_COMPANY
|
In function orangeComparebySize:
in the header documentation it says:
@return
1 - if size of orange1 is bigger then size of orange2,
-1 - if size of orange2 is bigger then size of orange1,
0 - if the sizes of the oranges are equal.
but in the pdf file the instructions are to return any positive number if the size of orange1 is
bigger then the size of orange2 .
Which instruction do we need to follow ? |
you should follow the instructions in the PDF file , that is, you need to return any positive number if orange1 is bigger then orange2 return any negative number if orange2 is bigger then orange1 return 0 if orange1 is equal to orange2
|
Note about function orangeRemoveFoodCompany |
When you remove a company from the array of companies you should move each of the companies that were after the removed company backward one place. for example :
array of companies = {"m1", "m2", "m3", "m4", NULL, NULL,NULL}
orangeRemoveCompany("m2");
after removing m2 the array will be:
array of companies = {"m1", "m3", "m4",NULL, NULL, NULL,NULL}
|
Can We use helper functions ? |
yes, any helper function you want to use should be defined as static in the .c file . you don't need to declare the function anywhere else in the code .
|
The selling price and max number of companies of an orange must be positive ? |
yes , must be positive , can't be zero .
|
In functions 10-12
What do we need to do with oranges that are expired ? |
Nothing . they stay in the cache and their state stays the same as it was before the function was called.
|
Function 12 : List cacheDeliverOrangesWithBiggestWeight(Cache cache);
can we use realloc ? |
NO , you are not allowed to use realloc function.
for allocating memory you are only allowed to use malloc or calloc.
|
In function 12 : cacheDeliverOrangesWithBiggestWeight
How to compare lexicography between companies ? |
you need to compare with the function strcmp from the string.h library.
if(strcmp(company1, company2) > 0 ) then company1 is greater.
|
Function 12 :
After finding all the oranges that we want to return, do we need to remove them from the
cache ? |
yes
|
In function 12, when we are calculating the total oranges weight, do we need to
count also oranges that are expired ? |
NO
|
In function 12 , the oranges that we are returning need to be removed from the cache ? |
YES
|
|