CS 3331 Lab 3 (Assignment): Solved

30.00 $

Category:

Description

5/5 - (1 vote)

You should write a NEW program. Redesign your Lab 1 & 2 assignments. Please NOTE that there are new requirements:

  • Create a text file with all the white pieces in their starting position. The format of the file shall be similar to the file used in Lab 1. Each line should include the name of figure, color, posX (A..H), posy. Each chess piece shall have a unique name, for example “RookA1 “, “BishopA2”, “KnightA3”, “PawnA2”. You may use text file StartGameWhitePieces
  • Read the file, create the correct type of chess piece, and add it to an array of chess Pieces
  • Given a new position by user, you should traverse each piece in the array and print, in one line and only for valid moves: PieceNameposXposY at posX, posy moved to newX, newY.
  • Consider a chess board with all white pieces in place for starting a new game. when moving a piece, assume that it is the only piece in the chess.

Constraints

  • You most use polymorphism
  • You must factor out all common behavior and attributes in a new class You shall not use interfaces
  • You must do first your algorithm, then the class diagram, and the pseudo code of the two most complex methods.
  • Lab_3.zip