Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL exam question

Re: PL/SQL exam question

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 2000/04/10
Message-ID: <8crr36$m0t$1@ctb-nnrp1.saix.net>#1/1

vsanker_at_yahoo.com wrote in message <8cq0ss$3hs$1_at_nnrp1.deja.com>...
>
>WHILE v_price < &&p_count LOOP
> v_amount:=v_amount + 1;
> v_price:=v_amount*&&p_pct_increase;
>END LOOP;
>
>If V_PRICE is 45, P_COUNT is 75, and V_AMOUNT is 5, which P_PCT_INCREASE
>value would cause the loop to terminate ?

In the previous loop itteration (from which the supplied values were given): 45 = 5 * pct_increase
p_pct_increase - 45 /5 = 9

But this tells us nothing about the p_pct_increase.

OK, for this loop itteration which must cause the loop to be terminated.

v_price (45) < p_count (75) : means that the loop is executed.

v_amount = 5 + 1 = 6

v_price = 6 x p_pct_increase
where v_price > p_count

p_count is 75, thus let us assume that v_price must be 76 in order to satisfy the greater than condition.

76 = 6 x p_pct_increase

p_pct_increase = 76 / 6 = 12.66667

Thus, any value of larger than a percentage increase of 12.6, will cause v_price to be larger than p_count.

>A. 0
>B. 15
>C. 20
>D. 45
>E. 75

B is the answer.

>I think it is 15 but the answer is 20.

Sez who? Assholes who can not program? Or do I have both my feet in my mouth and my leadpipe wrapped around my head with this one?

It seems to me that 15 is the right answer. Amount is 6 and you need to multiply it with a value that gives you a total that is larger than 75. Any integer from 13 up will give you that.

Billy Received on Mon Apr 10 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US