usp.price.belowten=15;
usp.price.belowfifty=15;
usp.price.belowonehundred=10;
usp.price.moreonehundred=10; //usp
}
supernestedif()
{
if (n>0 && n<11)
{
if (qty>0)
{
if (n==1)
{
if (qty<=10)
up=alg.price.belowten;
else if (qty>10 && qty<=50)
up=alg.price.belowfifty;
else if (qty>50 && qty<=100)
up=alg.price.belowonehundred;
else
up=alg.price.moreonehundred;
}
if (n==2)
{
if (qty<=10)
up=als.price.belowten;
else if (qty>10 && qty<=50)
up=als.price.belowfifty;
else if (qty>50 && qty<=100)
up=als.price.belowonehundred;
else
up=als.price.moreonehundred;
}
is there any way too shorten this?? T_T
The scenario is i have 10 products with two category,, its the price and the quantity,, if a user input the product number and the quantity,, i need to compare it to my list before it will give the output price... my problem is,, it is too long... i want to shorten it,, if possible.
another problem occurred. whenever i'm trying to cout one of the member like alg.price.belowten, it doesn't return the declared value but it returns 0.