Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 399 Weeks Ago, 1 Day Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 17 Sep 2017 My Price 9.00

UBCruises

1. Bad smells in the existing code

1.1 Bad smell definitions

 

Following points indicates the bad smells across the provided code

 

 

  • ship1 should be defined as singleton object in UBCruises class as it doesn't make any sense in defining the object as non-static because if UBCruises() constructor is called more than once in Main() method, then again new ship object is created and will differ.
  • No need of overriding default constructor in UBCruises.
  • No usage of Properties. Instead of public variables, properties should be implemented.
  • As the ship1 is singleton object, we can call setupShip method in a static constructor in UBCruises, so that only once for the execution it will be called by making setupShip() method too as static.
  • Instead of using ArrayList can use a generic collection List<> for ensuring type safety when using inbuilt comparison methods like select and where etc.,
  • User-defined exceptions are nowhere defined. For example, we can define a user-defined exception like CabinNotAvailableException and throw that if the Available() method returns false and can implement try/catch mechanism.

Implement IDisposable for UBCruises and override Dispose() method and clear all the collection objects in that and call it in main by implementing try/finally in the Main()

Answers

(5)
Status NEW Posted 17 Sep 2017 07:09 AM My Price 9.00

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

Not Rated(0)