Kreala university lab exam questions
Object Oriented Programming [ in Java] Lab Questions.
[NOTE:: The questions are not given as such.only the idea is there.Create the answer accordingly]
[1] There is a 5*5 checkerboard.Two players are there(Computer Vs player or Player1 Vs Player2) .Each Player is given alternate chances .He can click and check any of the columns by his sign.If the player get three consecutive columns marked(diagonally,horizontally or vertically),he wins and game is over.If all columns are marked and nobody wins,game is over with a draw.
[2]Given a grid , which consists of colored chips , which are randomly placed.Move colored chips trying to lineup to five or more of the same kind.
[3]A deck of cards are placed face down in a pile.When mouse is clicked,the top card is moved to deck2.Then on clicking mouse over deck2,that card is flipped.If card is queen,drag it and place it in deck3.Otherwise keep the card in deck2 itself.When the 4 queens are found and plced over pile 3 ,you win the game and game is over .
[4]Write a program in Java to implement eight queens problem.
[5]The game has 52 cards of the card game (diamonds,hearts,clubs,spades) .The cards are arranged in set of 4 into 13 groups in random order,face down.The first card of all thirteen groups are face up.There is an empty pile at the top called foundation.The aim is to remove all diamonds to the foundation . Cards(other than diamonds) can be built down in sequence regardless of suit. Builds of cards can be moved as a unit. Empty slots can be filled by any card (except for diamonds) or builds of cards. Diamonds cannot be moved except to be placed on to the foundation.
[6]Create an applet showing a pair of dice and which implements the following condition.When the user clicks on the applet ,the dice should be rolled,each dice showing from 1 to 6.Each dice should be drawn as a square.
[7]create an Applet having 3*3 grid containing eight buttons that are arranged randomly in a frame.The user has to rearrange the buttons to get the correct order.
[8]Create an applet that shows a die and a grid.The die rolls and shows random values on mouse clicks.The 5*5 grid,shows 1 to 25 numbers on it.Initially the number on the die is highlighted on the grid.Then the number to be highlighted is obtained by adding numbers showing newly on the dice to the previously highlighted number.
[9]Create an applet that show five piles of cards.From the first pile a card must be dragged to the other 4 piles.One of the four piles get the card and must be arranged in the order of their suit,rank and color values.The first pile of cards must be randomly arranged.
[10]Implement the game minesweeper in Java.
[11]Create an applet which contains a submarine moving continuously from left to right and back.There is a ship which holds a bomb in it.Thee ship can be moved left and right as we wish,using left and right arrow keys.When spacebar key is pressed ,the bomb is dropped.Our aim is to hit the submarine.
[12]Create an applet that shows a square box moving randomly.Try to catch that box and count the number of hits and misses.