Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

The program should be written in PL/SQL.

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

=+Who's your primary audience?

Answered: 1 week ago