Advanced Relational Database

Paper, Order, or Assignment Requirements

 

 

see attachments. Project 2 is method used for Project 1.

Note: Must be completed with Oracle SQL developer Version 4.0.3.16 used with Oracle SQL Server 11g.

Project 2 Break Down Instructions

For Project 2, you will implement the design as specified in project 1.
Some ideas for functions and procedures:
RANDOM function or package – picks a random number — 2 examples are given to you
PX procedure – prints stars for separation
PL procedure – to save typing DBMS_OUTPUT.PUT_LINE
GET_SUIT function – Use a random number from 1 – 4 to return one of four suits (‘Hearts’, ‘Clubs’, etc..)
GET_CARD_NAME function – turns a 1 into an ACE, a 2 into TWO, 11 into Jack, 12 into Queen, etc..
NORMALIZE function – to convert jacks, queens, and Kings into a value of ten
DRAW procedure – used by a player or dealer to draw a card
CHECK_BUSTED function – see if anyone has a score over 21
… you get the idea …
Example of desired output:
SQL> @objack1
Enter value for player_limit: 17
*******************************
Dealer’s turn:
Drew a Ten of Diamonds
That’s worth 10 points
. The total is now: 10 points.
*******************************
Player’s turn:
Drew a Five of Spades
That’s worth 5 points.
. The total is now: 5 points.
*******************************
Dealer’s turn:
Drew a Four of Hearts
That’s worth 4 points.
. The total is now: 14 points.
*******************************
Player’s turn:
Drew a Seven of Clubs
That’s worth 7 points.
. The total is now: 12 points.
******************************
Dealer’s turn:
Drew a Seven of Hearts
That’s worth 7 points.
. The total is now: 21 points
******************************
Player’s Turn:
Drew an Eight of Spades
That worth 8 points.
. The total is now: 20 points.
******************************
Dealer won. What a Shame. Oh well, Play again.

This is to get you started:
—————————————————————————————————————
DECLARE
p_score number := 0; — Player’s score – declare variables BEFORE
D_score number := 0; — Dealer’s score – procedures and functions
P_Limit number := &Player_Limit; — The highest number the player is
— willing to draw against.

Seed number := 8;
Seed2 number := 5;

 

Tags: