The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 2 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
In the board game Scrabble2, each tile contains a letter, which is used to spell words, and a score, which is used to determine the value of words.
1. Write a definition for a class named Tile that represents Scrabble tiles. The instance variables should be a character named letter and an integer named value.
2. Write a constructor that takes parameters named letter and value and initializes the instance variables.
3. Write a method named print Tile that takes a Tile object as a parameter and prints the instance variables in a reader-friendly format.
4. Write a method named test Tile that creates a Tile object with the letter Z and the value 10, and then uses print Tile to print the state of the object.
The point of this exercise is to practice the mechanical part of creating a new class definition and code that tests it.
Â
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on-----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be-----------