Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | May 2017 |
Last Sign in: | 304 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
a. Enhance the Triangle class of Exercise P5.16 by adding member functions perimeter and area that compute the perimeter and area of the triangle.
b. Design a class House that defines a house on a street. A house has a house number and an (x, y) location, where x and y are numbers between –10 and 10. The key member function is plot, which plots the house.
Next, design a class Street that contains a number of equally spaced houses. An object of type Street stores the first house, the last house (which can be anywhere on the screen), and the number of houses on the street. The Street::plot function needs to make the intermediate house objects on the fly, because you don’t yet know how to store an arbitrary number of objects.
Use these classes in a graphics program in which the user clicks with the mouse on the locations of the first and last house, then enters the house numbers of the first and last house, and the number of houses on the street. Then the entire street is plotted.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll