Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am posting 2 questions and you need to make two different programs. The reason I am posting 2 as they are related to each
I am posting 2 questions and you need to make two different programs. The reason I am posting 2 as they are related to each other. Thank you!!!!!
The program should be written in PL/SQL.
The program should be written in PL/SQL.
5) Find the formula for the Binomial Coefficient (N over K) on the Web. Write a PL/SQL function BINOMIAL(N, K) with two IN parameters N, K, that computes the binomial and returns the coefficient by calling your own FACTORIAL function. Write a main program that sends to the screen the binomial coefficients as follows. N= 4 K= 2 Binomial = N= 4 K=3 Binomial = N=5 K= 2 Binomial = N=5 K= 3 Binomial = N=5 K= 4 Binomial = 6) The Binomial Coefficient requires that N> 0 and K> -1 and N>=K. Write a function SAFE_BINOMIAL that sends to the screen three different error messages if the above three conditions are violated. If the above conditions are NOT violated, it should call BINOMIAL from question 5) and return the result Write a main program that calls SAFE_BINOMIAL as follows: N = 4 K= -1 N= 4 K= 5 N= 0 K= -1 (Hint: There should be TWO error messages given in this case !!!) N= 4 K= 2 N= 4 K = 3 At the three red arrows below show the code of SAFE_BINOMIAL, the code of the main program, and the result of the main program. [5] 5) Find the formula for the Binomial Coefficient (N over K) on the Web. Write a PL/SQL function BINOMIAL(N, K) with two IN parameters N, K, that computes the binomial and returns the coefficient by calling your own FACTORIAL function. Write a main program that sends to the screen the binomial coefficients as follows. N= 4 K= 2 Binomial = N= 4 K=3 Binomial = N=5 K= 2 Binomial = N=5 K= 3 Binomial = N=5 K= 4 Binomial = 6) The Binomial Coefficient requires that N> 0 and K> -1 and N>=K. Write a function SAFE_BINOMIAL that sends to the screen three different error messages if the above three conditions are violated. If the above conditions are NOT violated, it should call BINOMIAL from question 5) and return the result Write a main program that calls SAFE_BINOMIAL as follows: N = 4 K= -1 N= 4 K= 5 N= 0 K= -1 (Hint: There should be TWO error messages given in this case !!!) N= 4 K= 2 N= 4 K = 3 At the three red arrows below show the code of SAFE_BINOMIAL, the code of the main program, and the result of the main program. [5]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started