0% found this document useful (0 votes)
145 views

PL SQL Exercise1

The document outlines 6 PL/SQL exercises: 1) Write a program to calculate the perimeter and area of a rectangle with user-defined length and width. 2) Write a program that declares an integer variable, assigns a value, and computes and inserts the value, square, and cube into a table. 3) Write programs to convert between Fahrenheit and Celsius temperatures and display the output, taking user input. 4-6) Write additional programs to convert inches to yards/feet/inches, check if a user-input integer is divisible by 5, and check if the product of two user-input numbers is greater than or equal to 100, displaying the output.

Uploaded by

Sumit Tembhare
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views

PL SQL Exercise1

The document outlines 6 PL/SQL exercises: 1) Write a program to calculate the perimeter and area of a rectangle with user-defined length and width. 2) Write a program that declares an integer variable, assigns a value, and computes and inserts the value, square, and cube into a table. 3) Write programs to convert between Fahrenheit and Celsius temperatures and display the output, taking user input. 4-6) Write additional programs to convert inches to yards/feet/inches, check if a user-input integer is divisible by 5, and check if the product of two user-input numbers is greater than or equal to 100, displaying the output.

Uploaded by

Sumit Tembhare
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

PL*SQL Exercise 1

1. Write a program that computes the perimeter and the area of a rectangle. Define your own values for the length and width. (Assuming that L and W are the length and width of the rectangle, Perimeter = 2*(L+W) and Area = L*W. Display the output on the screen using dbms_output.put_line. 2. Write a program that declares an integer variable called num, assigns a value to it, and computes and inserts into the tempp table the value of the variable itself, its square, and its cube. 3. Convert a temperature in Fahrenheit (F) to its equivalent in Celsius (C) and vice versa. The required formulae are:C= (F-32)*5/9 F= 9/5*C + 32 Display the output on the screen using dbms_output.put_line. Data has to be input by the user. 4. Convert a number of inches into yards, feet, and inches. For example, 124 inches equals 3 yards, 1 foot, and 4 inches. Display the output on the screen using dbms_output.put_line. Data has to be input by the user. 5. Write a program that enables a user to input an integer. The program should then state whether the integer is evenly divisible by 5. (Use decode instead of IF statement where required). Display the output on the screen using dbms_output.put_line. Data has to be input by the user. 6. Your block should read in two real numbers and tell whether the product of the two numbers is equal to or greater than 100. Display the output on the screen using dbms_output.put_line. (Use decode instead of IF statement where required). Data has to be input by the user.

Sameer Dehadrai

Page: 1

You might also like