B. Because the computer can rearrange itself when it is in a phase of conversion
The program does not consists of any syntax error but the module contains error in logic especially while placing the condition inside if statement.
Here we are actually planning to check whether the number passed in the “value” variable is within the given lower and upper range which is passed in second and third parameter.
Solution 1:
if value<=lower AND value>=upper Then
Display “The given number is outside the specified range.”
else
Display “The given number is within the specified range.”
End if
Alternate solution:
So for that the condition needs to be value>=lower and value <=lower. so
if value > lower AND value <upper Then
Display “The given number is within the specified range.”
else
Display “The given number is within the specified range.”
Answer:
Check the explanation
Explanation:
bool oneSale(string item){
for(int i=0;i<capacity;i++){ // iterate till the capcity of array
if(item==grocerryList[i].name()){ // if name matches
if(grocerryList[i].getStock()>0){ // and stock is greater than 0
grocerryList[i].setStock(grocerryList[i].getStock()-1); // subtract 1 from the stock
// or alternate is grocerryList[i].stock= grocerryList[i].stock-1;
return true; // return true
}
}
else if(item==grocerryList[i].name()){ // if name matches
if(grocerryList.getStock()==0){ // but stock is empty
return false; // return falsse
}
}
else{ // means item is not available so there is no need to check stock
return false; // return false
}
}
}