11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Assignment 30:1. Write a program which stores the number of days in each month in an array. Thenwhen you ask the user to enter a number , it prints out the number of daysin that month.2. Write a program so that the computer plays the card game "WAR" against the user.Have an array hold the 52 cards in the deck. Deal them at random into two arrays, onefor each player. In each turn of play, each player plays the cards from her deck inorder. If the cards played by user and computer don't match, they both are put in the"booty" pile. If they do match, there will be a BATTLE. In the battle, each playerplays her next card. The high card wins the whole booty pile.3. We wrote "Eight Queens" for a standard 8x8 chess board. Change the "Eight Queens"so the user can choose any size board.4. Change "Eight Queens" into super queens. Each moves like a Queen and like a Knight.Are there any solutions?175

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!