Answer:
int calculate_cost(int quantity) {
double cost = 0;
if (quantity <= 20)
cost = quantity * 23.45;
else if (quantity >= 21 && quantity <= 100)
cost = quantity * 21.11;
else if (quantity > 100)
cost = quantity * 18.75;
return cost;
}
Explanation:
Create a function called calculate_cost that takes one parameter, quantity
Initialize the cost as 0
Check the quantity using if else structure. Depending on the quantity passed, calculate the cost. For example, if the quantity is 10, the cost will be $234.5
Return the cost
Answer:
Binary Scope Resolution Operator
Explanation:
The :: (scope resolution) operator is used to get hidden names due to variable scopes so that you can still use them. The scope resolution operator can be used as both unary and binary. Fortunately, in this context we're not dealing with hidden contents; thus the Binary applies better than the Unary.
Cheers
Answer:
a thing that happens or takes place, especially one of importance.
2 or 3 ways.......................................