بتاريخ: 20 أبريل 201015 سنة comment_189982 Creat a function that takes a number as its input, and returns a sum, which is defined as follows: If the input is positive, for example, 10, the returned sum should be:1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.- If the input is negative, for example, -10, the returned sum should be:-10 -9 - 8 - 7 -6 - 5 - 4 - 3 - 2 - 1 = -55.You need to create two versions of the function. One is implemented in NUMBER datatype and the otherin BINARY INTEGER.Once these two functions are created, you need to create a testing procedure in which the execution speedof the two sum functions are compared. The testing procedure should have a similar output as the oneshown below:bSum(40000) = 800020000Time used in running bSum(10000): 5 milisecondsnSum(40000) = 800020000Time used in running nSum(10000): 20 milisecondswhere bSum and nSum are the names of the sum function implemented in BINARY INTEGER and NUMBERrespectively. In implementing the testing function, you may need to use TIMESTAMP, SYSTIMESTAMP,INTERVAL DAY TO SECOND, and EXTRACT to get the needed information for output. تم تعديل 20 أبريل 201015 سنة بواسطة free2000000 تقديم بلاغ
بتاريخ: 23 أبريل 201015 سنة كاتب الموضوع comment_190251 I get an answer I’ll uploaded in a few daysThank you guys تقديم بلاغ
بتاريخ: 23 أبريل 201015 سنة comment_190269 create function fn1 is (input_p number,output_p out number) begin declare sm_val number:=0; begin if input_p >0 then for i in 1..input_p loop sm_val :=sm_val +i; end loop; elsif input_p<0 then for i in input_p..-1 loop sm_val :=sm_val +i; end loop; end if; end; end; ده إن اشاء يكون مفتاح للاجابه ابا بخصوص وقت تنفيذ عمليه الجمع تقوم بقراءه الوقت الحالى للجهاز وبعد الانتهاء تقوم بنفس الموضوع وتاتى بالفرق سيكون هو الوقت المستغرق تقريبا تم تعديل 23 أبريل 201015 سنة بواسطة amr fawzy تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.