{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Intro2ProgrammingWeek2

Oracle plsql create or replace procedure myexample as

Info iconThis preview shows pages 3–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Oracle PL/SQL CREATE OR REPLACE PROCEDURE myexample AS age NUMBER; salary NUMBER; middle_initial CHAR(1); BEGIN age := 21; salary := 29521.12; middle_initial := 'K'; DBMS_OUTPUT.PUT_LINE('I am ' || age || ' years old'); DBMS_OUTPUT.PUT_LINE('I make ' || TO_CHAR(salary, '99999.99') || ' per year'); DBMS_OUTPUT.PUT_LINE('My middle initial is ' || middle_initial); END; Java class myexample { public static void main (String args []) { int age; double salary; String middle_initial; age = 21; salary = 29521.12; middle_initial = "K"; System.out.println ("I am " + age + " years old "); System.out.println ("I make " + salary + " per year"); System.out.println ("My middle initial is " + middle_initial); } } Perl #!/usr/local/bin/perl $ age = 21; $salary = 29521.12; $middle_initial = "K"; print "I am " . $age . " years old "; print "I make " . $salary . " per year "; print "My middle initial is " . $middle_initial; Basic Dim age AS Integer Dim salary AS Decimal Dim middle_initial As String
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
age = 21 salary = 29521.12 middle_initial = "K" print "I am " & age & " years old " print "I make " & $salary & " per year " In the above examples it is clear that different programming languages have slightly different syntax and data types. However for the most part, variable declaration is straight forward. Real differences begin to appear when more complex data structures such as arrays and pointers are declared. Such discussion is best left for programming courses. Key Terms: Datatypes o INT o CHAR: character o Float Assignment OP o /* /* Variables o Printf Display to screen o Scanf Awaits input from user o Const Flt Chr Int Key Words o There are 29 keywords Operators o Operates on symbols
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page3 / 4

Oracle PLSQL CREATE OR REPLACE PROCEDURE myexample AS age...

This preview shows document pages 3 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online