subject

SECTION A

Using Scalar Variables

Create a PL/SQL block containing the following variables:

NAME DATA TYPE OPTION INITIAL VALUE

lv_test_date DATE December 10, 2012

lv_test_num NUMBER (3) CONSTANT 10

lv_test_txt VARCHAR2 (10)

Assign your last name as the value of the text variable in the executable section of the block. Include statements in the block to display each variable’s value onscreen.

CREATING A FLOWCHART

The brewbean’s application needs a block that determines whether a customer is rated high, mid, or low based on his or her total purchases. The block needs to determine the rating and then display the results on screen. The code rates the customer high if total purchase are greater than $200, mid if greater than $100, and low if $100 or lower. Develop a flowchart to outline the conditional processing steps needed for this block

USING IF STATEMENTS

Create a block using an IF statement to perform the actions described in (2) above. Use a scalar variable for the total purchase amount, and initialize this variable to different values to test your block.

USING CASE STATEMENTS

Create a block using a CASE statement to perform the actions described in (3) above. Use a scalar variable for the total purchase amount, and initialize this variable to different values to test your block.

USING A BOOLEAN VARIABLE

Brewbean’s needs program code to indicate whether an amount is still due on an account when a payment is received. Create a PL/SQL block using a Boolean variable to indicate whether an amount is still due. Declare and initialize two variables to provide input for the account balance and payment amount received. A TRUE Boolean value should indicate an amount is still owed, and FALSE value should indicate the account is paid in full. Use output statements to confirm that the Boolean variable is working correctly.

USING LOOPING STATEMENTS

Create a block using a loop that determines the number of items that can be purchased based on the item prices and the total available to spend. Include one initialized variable to represent the price and another to represent the total available to spend. (You could solve it with division, but you need to practice using loop structures.). The block should include statements to display the total number of items that can be purchased and the total amount spent.

CREATING A FLOWCHART

Brewbean’s determine shipping costs based on the number of items ordered and club membership status. The applicable rates are shown in the following chart. Develop a flowchart to outline the condition-processing steps needed to handle this calculation.

QUANTITY OF ITEMS NONMEMBER SHIPPING COST MEMBER SHIPPING COST

Up to 3 $5.00 $3.00

4-6 $7.50 $5.00

7-10 $10.00 $7.00

More than 10 $12.00 $9.00

USING IF STATEMENTS

Create a block to accomplish the task outlined in (7) above. Include a variable containing a Y or N to indicate membership status and a variable to represent the number of items purchased. Test with a variety of values.

(75% of mark)

SECTION B

Create a single row subqueries using the following operators =, <, >, >=, <=, <>, using a WHERE clause, HAVING clause.

Create a multiple row subqueries using IN, ANY, ALL, EXISTS operator using a WHERE clause, HAVING clause.

Create a nested subqueries using two or more tables in the database.

(25% of mark)

Upload your file to the drop box.

This assignment is due on Wed. Oct 18th 2017 at 10 pm.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
What does 21 pilots middle aged name as a band 15 years prior to them naming their band 21 pilots?
Answers: 1
question
Computers and Technology, 23.06.2019 05:20
What did creator markus “notch" persson initially call his game
Answers: 1
question
Computers and Technology, 24.06.2019 17:50
You will subnet the network address 172.31.103.0/24. the network has the following requirements: · room-114 lan will require 27 host ip addresses · room-279 lan will require 25 host ip addresses · room-312 lan will require 14 host ip addresses · room-407 lan will require 8 host ip addresses how many subnets are needed in the network topology?
Answers: 2
question
Computers and Technology, 24.06.2019 21:30
Computer security/cybersecurity1) each of the following code fragments contains a number of security vulnerabilities. for each fragment, identify these security vulnerabilities and, for each vulnerability, discuss at least one way that it could be improved. note that in your discussion of how each vulnerability could be improved, you do not need to re-write a new version of the program in c; simply discuss your solution, either in pseudocode or in 1-2 sentences.a) /* file descriptor leak */#include #include int main(int argc, char *argv[]){ char *filepath = argv[0]; char *shellpath = argv[1]; file *passwords; passwords = fopen(filepath, "r"); /* read the password and do something with it */ /* . . */ /* fork and execute alternative shell */ execl(shellpath, "shell", null); }b)#include /* assume the following function is written for an electronic storefront. the user will enter the id of the item to be ordered, as well as the quantity of units that they would like to purchase. the program will then lookup the price for the price for the item using a predefined function, and return the total cost of the order.*/int gettotalcost(){ char itemid[9]; int price, unitsordered, cost; printf(" enter the 9-digit id of the item to be ordered: "); scanf("%s", & itemid); /* lookup the price according to the itemid */ price = getpricebyid(itemid); printf(" enter the quantity of units to be ordered: "); scanf("%d", & unitsordered); cost = price * unitsordered; return cost; }c)#include /* the following function is intended to return a user's full name by concatenating the user's first and last name into a single string and then returning that string. */char *getfullname(char *firstname, char *lastname, int max_len){ char fullname[max_len]; strcpy(fullname, firstname); strcat(fullname, " "); strcat(fullname, lastname); return fullname; }d)#include /* the following code snippet runs through the list of cli arguments entered and displays them to the console. */int main(int argc, char *argv[]){ int i; printf("you've entered the following arguments: "); for(i = 0; i < argc; i++){ print(argv[i]); printf("\n"); } /* */}
Answers: 2
You know the right answer?
SECTION A

Using Scalar Variables

Create a PL/SQL block containing the foll...
Questions
question
Physics, 04.11.2021 09:00
question
Mathematics, 04.11.2021 09:00
Questions on the website: 13722367