Programming Assignment #1 Programming Assignment #1 (due date: see Blackboard) 1. This program tests the concepts of: Class Definition & Implementation Public/Protected/Private Members Static Data...

instructions are in the file


Programming Assignment #1 Programming Assignment #1 (due date: see Blackboard) 1. This program tests the concepts of: Class Definition & Implementation Public/Protected/Private Members Static Data Members Constructors Member Functions Data Member Classes as Member Data Dynamic Array of Objects Pointers 10. Program Objective: Create class named scrabbleTile. A scrabbleTile object will store the letter and point value of a Scrabble tile. Note that blank tiles are represented by the ? character. scrabbleTile will have the following member functions: scrabbleTile(char, value), constructor to create a tile ~scrabbleTile(), destructor (optional) set(char), sets a blank tile's letter letter(), returns the tile's letter value(), returns the tile's point value isBlank(), returns true if tile is a blank No other member or non-member functions are required. Create class named scrabbleBag. A scrabbleBag object will store a collection of scrabbleTile objects in a dynamic array. scrabbleBag will have the following member functions: scrabbleBag(), creates an empty scrabbleBag scrabbleBag(scrabbleBag), creates a copy of a scrabbleBag ~scrabbleBag(), destructor clear(), empties the scrabbleBag of all scrabbleTiles size(), that returns the number of scrabbleTiles in the scrabbleBag reload(), loads the scrabbleBag with a standard set of scrabbleTile objects (see table below) isEmpty(), return true if the bag is empty add(scrabbleTile), inserts a scrabbleTile into the scrabbleBag remove(scrabbleTile), removes the passed scrabbleTile from the scrabbleBag draw(Integer), removes and returns either a scrabbleTile by index or at random (if no parameter is passed) from the scrabbleBag find(scrabbleTile), returns index to the passed tile or npos if not found at(Integer) returns a constant scrabbleTile by index< tostring(), returns a copy of the scrabblebag's tiles as a string. lettercount(char): a non-member function that returns the quantity of each letter in a standard scrabble bag. lettervalue(char): a non-member function that returns a letter's value no other member or non-member functions are required. a simple demo program has been posted to show the functionality of your classes. feel free to create your own version of the game after you have the classes working with my program. no container classes are allowed to be used. all non-constant arrays must be implemented as dynamic arrays. include documentation for your class definition and implementation. file description scrabble.cpp scrabble main program file (file is provided) this file may not be edited. scrabble.exe executable game of scrabble based on main program file (file is provided) don't expect a fully functioning game! collins scrabble words (2015).txt collins scrabble words (2015) text file (file is provided) this file may not be editted. scrabbleboard.hxx scrabble board header file (file is provided) this file may not be edited. scrabbleboard.cxx scrabble board implementation file (file is provided) this file may not be edited. scrabbletile.hxx scrabbletile header file scrabbletile.cxx scrabbletile implementation file scrabblebag.hxx scrabblebag header scrabblebag.cxx scrabblebag implementation file 16. record layouts: none. 17. special calculations: none. 18. specific processing: none. 19. output layout: (part of code supplied) loading game. should only take a couple of seconds. welcome to scrabble! would you like to display the rules? (y or n): n would you like the tile table displayed while playing? (y or n): y would you like to display the # of tiles left in the bag while playing? (y or n): y would you like invalid words to be challenged? (y or n): y how many players are in game? (1 to 4): 3 a b c d e f g h i j k l m n o +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ a |3ws| | |2ls| | | |3ws| | | |2ls| | |3ws| a: 9/1, n: 6/1 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ b | |2ws| | | |3ls| | | |3ls| | | |2ws| | b: 2/3, o: 8/1 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ c | | |2ws| | | |2ls| |2ls| | | |2ws| | | c: 2/3, p: 2/3 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ d |2ls| | |2ws| | | |2ls| | | |2ws| | |2ls| d: 4/2, q: 1/10 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ e | | | | |2ws| | | | | |2ws| | | | | e:12/1, r: 6/1 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ f | |3ls| | | |3ls| | | |3ls| | | |3ls| | f: 2/4, s: 4/1 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ g | | |2ls| | | |2ls| |2ls| | | |2ls| | | g: 3/2, t: 6/1 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ h |3ws| | |2ls| | | |2ws| | | |2ls| | |3ws| h: 2/4, u: 4/1 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ i | | |2ls| | | |2ls| |2ls| | | |2ls| | | i: 9/1, v: 2/4 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ j | |3ls| | | |3ls| | | |3ls| | | |3ls| | j: 1/8, w: 2/4 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ k | | | | |2ws| | | | | |2ws| | | | | k: 1/5, x: 1/8 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ l |2ls| | |2ws| | | |2ls| | | |2ws| | |2ls| l: 4/1, y: 2/4 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ m | | |2ws| | | |2ls| |2ls| | | |2ws| | | m: 2/3, z: 1/10 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ n | |2ws| | | |3ls| | | |3ls| | | |2ws| | ? (blank): 2/0 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ o |3ws| | |2ls| | | |3ws| | | |2ls| | |3ws| tile count: 79 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ player 0: rack="?ayydmr", score=0 position (rc or 00 to reload rack): hh word (00 to reload rack): 20. other: note that the tile table to the right of the board is formatted as follows: letter: # of tiles of that letter / point value of that letter so "p: 2/3" means that there are 2 'p' tiles in the bag at the start of the game and each 'p' tile is worth 3 points. tostring(),="" returns="" a="" copy="" of="" the="" scrabblebag's="" tiles="" as="" a="" string.="" lettercount(char):="" a="" non-member="" function="" that="" returns="" the="" quantity="" of="" each="" letter="" in="" a="" standard="" scrabble="" bag.="" lettervalue(char):="" a="" non-member="" function="" that="" returns="" a="" letter's="" value="" no="" other="" member="" or="" non-member="" functions="" are="" required.="" a="" simple="" demo="" program="" has="" been="" posted="" to="" show="" the="" functionality="" of="" your="" classes.="" feel="" free="" to="" create="" your="" own="" version="" of="" the="" game="" after="" you="" have="" the="" classes="" working="" with="" my="" program.="" no="" container="" classes="" are="" allowed="" to="" be="" used.="" all="" non-constant="" arrays="" must="" be="" implemented="" as="" dynamic="" arrays.="" include="" documentation="" for="" your="" class="" definition="" and="" implementation.="" file="" description="" scrabble.cpp="" scrabble="" main="" program="" file="" (file="" is="" provided)="" this="" file="" may="" not="" be="" edited.="" scrabble.exe="" executable="" game="" of="" scrabble="" based="" on="" main="" program="" file="" (file="" is="" provided)="" don't="" expect="" a="" fully="" functioning="" game!="" collins="" scrabble="" words="" (2015).txt="" collins="" scrabble="" words="" (2015)="" text="" file="" (file="" is="" provided)="" this="" file="" may="" not="" be="" editted.="" scrabbleboard.hxx="" scrabble="" board="" header="" file="" (file="" is="" provided)="" this="" file="" may="" not="" be="" edited.="" scrabbleboard.cxx="" scrabble="" board="" implementation="" file="" (file="" is="" provided)="" this="" file="" may="" not="" be="" edited.="" scrabbletile.hxx="" scrabbletile="" header="" file="" scrabbletile.cxx="" scrabbletile="" implementation="" file="" scrabblebag.hxx="" scrabblebag="" header="" scrabblebag.cxx="" scrabblebag="" implementation="" file="" 16.="" record="" layouts:="" none.="" 17.="" special="" calculations:="" none.="" 18.="" specific="" processing:="" none.="" 19.="" output="" layout:="" (part="" of="" code="" supplied)="" loading="" game.="" should="" only="" take="" a="" couple="" of="" seconds.="" welcome="" to="" scrabble!="" would="" you="" like="" to="" display="" the="" rules?="" (y="" or="" n):="" n="" would="" you="" like="" the="" tile="" table="" displayed="" while="" playing?="" (y="" or="" n):="" y="" would="" you="" like="" to="" display="" the="" #="" of="" tiles="" left="" in="" the="" bag="" while="" playing?="" (y="" or="" n):="" y="" would="" you="" like="" invalid="" words="" to="" be="" challenged?="" (y="" or="" n):="" y="" how="" many="" players="" are="" in="" game?="" (1="" to="" 4):="" 3="" a="" b="" c="" d="" e="" f="" g="" h="" i="" j="" k="" l="" m="" n="" o="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" a="" |3ws|="" |="" |2ls|="" |="" |="" |3ws|="" |="" |="" |2ls|="" |="" |3ws|="" a:="" 9/1,="" n:="" 6/1="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" b="" |="" |2ws|="" |="" |="" |3ls|="" |="" |="" |3ls|="" |="" |="" |2ws|="" |="" b:="" 2/3,="" o:="" 8/1="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" c="" |="" |="" |2ws|="" |="" |="" |2ls|="" |2ls|="" |="" |="" |2ws|="" |="" |="" c:="" 2/3,="" p:="" 2/3="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" d="" |2ls|="" |="" |2ws|="" |="" |="" |2ls|="" |="" |="" |2ws|="" |="" |2ls|="" d:="" 4/2,="" q:="" 1/10="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" e="" |="" |="" |="" |="" |2ws|="" |="" |="" |="" |="" |2ws|="" |="" |="" |="" |="" e:12/1,="" r:="" 6/1="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" f="" |="" |3ls|="" |="" |="" |3ls|="" |="" |="" |3ls|="" |="" |="" |3ls|="" |="" f:="" 2/4,="" s:="" 4/1="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" g="" |="" |="" |2ls|="" |="" |="" |2ls|="" |2ls|="" |="" |="" |2ls|="" |="" |="" g:="" 3/2,="" t:="" 6/1="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" h="" |3ws|="" |="" |2ls|="" |="" |="" |2ws|="" |="" |="" |2ls|="" |="" |3ws|="" h:="" 2/4,="" u:="" 4/1="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" i="" |="" |="" |2ls|="" |="" |="" |2ls|="" |2ls|="" |="" |="" |2ls|="" |="" |="" i:="" 9/1,="" v:="" 2/4="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" j="" |="" |3ls|="" |="" |="" |3ls|="" |="" |="" |3ls|="" |="" |="" |3ls|="" |="" j:="" 1/8,="" w:="" 2/4="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" k="" |="" |="" |="" |="" |2ws|="" |="" |="" |="" |="" |2ws|="" |="" |="" |="" |="" k:="" 1/5,="" x:="" 1/8="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" l="" |2ls|="" |="" |2ws|="" |="" |="" |2ls|="" |="" |="" |2ws|="" |="" |2ls|="" l:="" 4/1,="" y:="" 2/4="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" m="" |="" |="" |2ws|="" |="" |="" |2ls|="" |2ls|="" |="" |="" |2ws|="" |="" |="" m:="" 2/3,="" z:="" 1/10="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" n="" |="" |2ws|="" |="" |="" |3ls|="" |="" |="" |3ls|="" |="" |="" |2ws|="" |="" (blank):="" 2/0="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" o="" |3ws|="" |="" |2ls|="" |="" |="" |3ws|="" |="" |="" |2ls|="" |="" |3ws|="" tile="" count:="" 79="" +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+="" player="" 0:="" rack="?AYYDMR" ,="" score="0" position="" (rc="" or="" 00="" to="" reload="" rack):="" hh="" word="" (00="" to="" reload="" rack):="" 20.="" other:="" note="" that="" the="" tile="" table="" to="" the="" right="" of="" the="" board="" is="" formatted="" as="" follows:="" letter:="" #="" of="" tiles="" of="" that="" letter="" point="" value="" of="" that="" letter="" so="" "p:="" 2/3"="" means="" that="" there="" are="" 2="" 'p'="" tiles="" in="" the="" bag="" at="" the="" start="" of="" the="" game="" and="" each="" 'p'="" tile="" is="" worth="" 3="">
Feb 22, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here