shortening a super nested if with struct function c++

prodref()
{
products alg, als, br, st, acre, acri, imp, mirr, mag, usp;

//Prices
alg.price.belowten=140;
alg.price.belowfifty=85;
alg.price.belowonehundred=75;
alg.price.moreonehundred=70; //aluminum gold

als.price.belowten=140;
als.price.belowfifty=85;
als.price.belowonehundred=75;
als.price.moreonehundred=70; //aluminum silver

br.price.belowten=250;
br.price.belowfifty=200;
br.price.belowonehundred=155;
br.price.moreonehundred=115; //brass

st.price.belowten=250;
st.price.belowfifty=200;
st.price.belowonehundred=155;
st.price.moreonehundred=115; //steel

acre.price.belowten=130;
acre.price.belowfifty=75;
acre.price.belowonehundred=65;
acre.price.moreonehundred=60; //engrave

acri.price.belowten=130;
acri.price.belowfifty=75;
acri.price.belowonehundred=65;
acri.price.moreonehundred=70; //imprint

imp.price.belowten=100;
imp.price.belowfifty=80;
imp.price.belowonehundred=75;
imp.price.moreonehundred=70; //imprint

mirr.price.belowten=130;
mirr.price.belowfifty=75;
mirr.price.belowonehundred=65;
mirr.price.moreonehundred=60; //mirrorized

mag.price.belowten=55;
mag.price.belowfifty=55;
mag.price.belowonehundred=50;
mag.price.moreonehundred=50; //magnet

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.
Topic archived. No new replies allowed.