Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

PRACTICAL: Question 4 (Marks: 10)

Create a PL/SQL query to display the customer’s name and the pet that was purchased. In your solution only display the pet sale quantity greater than 1.

Sample Output

---------------------------------------------------

CUSTOMER NAME: Barry Goodwin

PET TYPE: Dog - Jack Russel

SALE QUANTITY 2

---------------------------------------------------

CUSTOMER NAME: Steven Hewson

PET TYPE: Bird - Budgie

SALE QUANTITY 3

--------------------------------------------------- 


Write a program for implementation of priority queue with character data elements. Each
element has an integer priority number between 1-5. Implement Enqueue () and Dequeue ()
functions in each of the following cases.
1. Linked list implementation of priority queue.
2. Array implementation of priority queue.

1)Explain to Top Management the various program categories that will enable you to operate a database in Oracle. Discuss at least three of these program categories. (10 Marks)


2)Identify and briefly explain the five features of PL/SQL that allow the developer to write effective code to manipulate a database. (10 Marks)



Using a switch statement, write a program that prompts the user for a numeric code and two operands. The numeric codes of 1, 2, 3, and 4 represents addition, subtraction, multiplication, and division respectively. Before division, your program should check whether the second operand is not zero. If it is, it should display “Division by zero not allowed” to the screen.

Sample Run1

Code: 1

Operand1: 5

Operand2: 4

Output1: Sum = 9

Sample Run 2

Code: 3

Operand1: 5

Operand2: 4

Output2: Product = 20

Sample Run 3

Code: 4

Operand1: 5

Operand2: 0

Output3: Division by zero not allowed



Define a structure that represents Fruit with properties fruit name, fruit type, fruit color.
Write a program that accepts data of four fruits and displays the results.

Create a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate

Sample Run1

Enter two numbers: 3 15

Do you want another operation: Yes

Enter two numbers: 45 56

Do you want another operation: No

Output1: Sum = 119

Sample Run2

Enter two numbers: 33 150

Do you want another operation: Yes

Enter two numbers: -56 56

Do you want another operation: Yes

Enter two numbers: 58 15

Do you want another operation: Yes

Enter two numbers: 123 87

Do you want another operation: No

Output2: Sum = 466


  1. Printing triangles: Write a program which inputs a positive integer n and outputs an n line high triangle of '*' characters whose right-angle is in the bottom left corner. For example, if 5 is input the output should be

 

Sample Run1

Enter a positive integer5

Output1:

*

**

***

****

*****

 

Sample Run2

Enter a positive integer-36

Output1: The number entered is not positive

 

Sample Run3

Enter a positive integer10

Output1:

*

**

***

****

*****

******

*******

********

*********

**********


Using a for loop create a program that will prompts the user for two numbers and then print out a list of even number in between the two given numbers(inclusive), starting from the small number to the big number

Sample Run1

Enter two numbers: 1 10

Output1: 2 4 6 8 10

Sample Run2

Enter two numbers: 9 5

Output2: 6 8


Body Mass Index (BMI) is one of the criteria that is used to calculate whether one is fit or not basing on a person’s height (m) and weight (kg). The criterion is very simple; if one’s BMI is 25 or greater, it signifies overweight. A BMI less or equal to 18.5 indicates underweight. Lastly, a BMI greater than 30 shows obesity.

You have been requested to create a program that that helps the Namibian Defence Forces’ (NDF) Captain to calculates the BMI of a person (BMI = weight/height2) and also determine whether the person has also completed running 10 km in the required time. Men should complete 10km in less than 60 minutes for them to be accepted. Women should do that under 80 minutes. Both males and females are accepted if their BMI is less than 25 and greater than 18.5. For 2018 intake, there are already 6 males selected and 1 female. The values for gender, mass and weight are enter by user inputs


Create a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate

Sample Run1

Enter two numbers: 3 15

Do you want another operation: Yes

Enter two numbers: 45 56

Do you want another operation: No

Output1: Sum = 119

Sample Run2

Enter two numbers: 33 150

Do you want another operation: Yes

Enter two numbers: -56 56

Do you want another operation: Yes

Enter two numbers: 58 15

Do you want another operation: Yes

Enter two numbers: 123 87

Do you want another operation: No

Output2: Sum = 466


LATEST TUTORIALS
APPROVED BY CLIENTS