Question

In: Computer Science

Assignment 2- 9   USING A FOR LOOP Create a PL/SQL block using a FOR loop to...

Assignment 2- 9   USING A FOR LOOP

Create a PL/SQL block using a FOR loop to generate a payment schedule for a donor’s pledge, which is to be paid monthly in equal increments. The values variable for the block is starting payment due date, monthly payment amount, and a number of total monthly payments for the pledge. The list that’s generated should display a line for each monthly payment showing payment number, date due, payment amount, and donation balance (remaining amount of pledge owed).

Assignment 2 – 10   USING A BASIC LOOP

Accomplish the task in Assignment 2-9 above by using a basic loop structure.

Assignment 2 – 11   USING A WHILE LOOP

Accomplish the task in Assignment 2-9 by using a WHILE loop structure. Instead of displaying the donation balance (remaining amount of pledge owed) on each line of output, display the total paid to date.

Assignment 2 – 12 USING A CASE EXPRESSION

Donors can select one of three payment plans for a pledge indicated by the following codes: 0 = one-time (lump sum) payment, 1 = monthly payments over one year, and 2 = monthly payments over two years. A local business has agreed to pay matching amounts on pledge payments during the current month. A PL/SQL block is needed to identify the matching amount for a pledge payment. Create a block using the input values of a payment plan code and a payment amount. Use a CASE expression to calculate the matching amount, based on the payment plan codes 0 = 25%, 1 = 50%, 2 = 100%, and other = 0. Display the calculated amount.

Assignment 2 – 13 USING NESTED IF STATEMENTS

An organization has committed to matching pledge amounts based on the donor type and pledge amount. Donor types include I = Individual, B = Business organization, and G = Grant funds. The matching percents are to be applied as follows:

Donor Type

Pledge Amount

Matching (%)

I

$100-$249

50%

I

$250-$499

30%

I

$500 or more

20%

B

$100-$499

20%

B

$500-$999

10%

B

$1,000 or more

5%

G

$100 or more

5%

            Create a PL/SQL block using nested IF statements to accomplish the task. The input value for the block is the donor type code and the pledge amount.

Solutions

Expert Solution

Answer 2-9)


Related Solutions

ORACLE TASK 2-2 USING A FOR LOOP Create a PL/SQL block using a FOR loop to...
ORACLE TASK 2-2 USING A FOR LOOP Create a PL/SQL block using a FOR loop to generate a payment schedule for a donor’s pledge, which is to be paid monthly in equal increments. Values variable for the block are starting payment due date, monthly payment amount and number of total monthly payments for the pledge. The list that’s generated should display a line for each monthly payment showing payment number, date due, payment amount, and donation balance (remaining amount of...
PL/SQL Write a PL/SQL block, using a While Loop, to calculate and print the sum of...
PL/SQL Write a PL/SQL block, using a While Loop, to calculate and print the sum of the odd integers from 10 to 120 inclusive. (Hint: 11 + 13 + 15 + . . . + 97 + 99)
Create a PL/SQL anonymous block that uses a nested loop (inner loop 1 to 15; outer...
Create a PL/SQL anonymous block that uses a nested loop (inner loop 1 to 15; outer loop 1 to 5) to perform computations using the SQL functions, ABS, EXP, SQRT, ROUND, MIN, MAX, LOG, MOD, REMAINDER and POWER The outer loop will use the functions, ABS, EXP, SQRT, ROUND to display the following messages (must be “ The absolute value of <outer loop index> is <value>” “ The value of e to the <outer loop index> power is <value>” “...
PL/SQL Write a PL/SQL block, using a Case Statement that prints a student’s letter     grade...
PL/SQL Write a PL/SQL block, using a Case Statement that prints a student’s letter     grade based on the value stored in a variable called grade. Use the ACC      grading system described in the course syllabus to create the block and set     the initial value of grade as 95. Use only one print statement and no      logical operators in your code. Assume a grade can exceed 100, but it      can’t be negative. Grade Scale: Grade Scale:...
Create a PL/SQL block to retrieve and display data for all pledges made in a specified...
Create a PL/SQL block to retrieve and display data for all pledges made in a specified month. One row of output should be displayed for each pledge. Include the following in each row of output:    - Pledge ID, donor ID, and Pledge Amount - If the pledge is being paid in a lump sum, display "LUMP SUM". - If the pledge is being paid in monthly payments, display "Monthly - #" (With the # representing the number of months...
Utilize the Outdoor Clubs & Product database to create a PL/SQL anonymous block program unit that...
Utilize the Outdoor Clubs & Product database to create a PL/SQL anonymous block program unit that lists the product_name attribute value and a demand status text display. The demand status text display is determined by counting the number of times a product has been ordered so far. The demand status text display will be either “Low Demand” or “High Demand”. Low Demand is displayed if the product has been ordered less than 2 times. High Demand is displayed if the...
Using SQL Developer Question 1 Create a block to retrieve and display pledge and payment information...
Using SQL Developer Question 1 Create a block to retrieve and display pledge and payment information for a specific donor. For each pledge payment from the donor, display the pledge ID, pledge amount, number of monthly payments, payment date, and payment amount. The list should be sorted by pledge ID and then by payment date. For the first payment made for each pledge, display “first payment” on that output row. Question 2 Redo question 1, but use a different cursor...
Create Procedure in (PL/SQL) called Make_Account (v_first, v_last, v_email, v_errormsg) Add a new user to the...
Create Procedure in (PL/SQL) called Make_Account (v_first, v_last, v_email, v_errormsg) Add a new user to the Account table. If the new user cannot be added, return a error message. Table Account (this is the table I need to add data using PROCEDURE) Account_no (PK) Email (VARCHAR2) first (VARCHAR2) last (VARCHAR2)
LP3.1 Assignment: Using Advanced SQL This assignment will assess the competency 3. Construct advanced SQL queries....
LP3.1 Assignment: Using Advanced SQL This assignment will assess the competency 3. Construct advanced SQL queries. Directions: Using the sample dataset, create three queries including a search, outer join and subquery. Create a table on how to use the query optimizer with these queries. Include screenshots and an explanation on why and when to use the optimizer. .
Create a new SQL Developer SQL worksheet and create/run the following TWO (2) queries and save...
Create a new SQL Developer SQL worksheet and create/run the following TWO (2) queries and save your file as Comp2138LabTest1_JohnSmith100123456.sql (replace JohnSmith 100123456 with your name and student ID). Please place comment that includes your name and your student ID at the top of your script and number your queries using comments sections. Each query carries equal weight. A selection of the expected result set has been shown below for your convenience. Your output should match with this sample output....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT