Homework Solution: Need this program coded with the correct output which is provided. Programming language is JAVA….

    Need this program coded with the correct output which is provided. Programming language is JAVA. Purpose: To review defining a Class of objects, instantiating objects of that class, and calling methods of the instantiated object. Instructions: Write a Java class named Ship to meet the requirements described in the following UMLClass Diagram. Shi Attributes Name of the ship Type of the ship Year of build Builder company rivate name: Strin private type: String rivate year: int private builder: String Operations ceconstructor>> Ship): Shi <<constructor» Ship(name: String, Default or null constructor Constructor accepting four(4) parameters. Returns a fully formed and fully functional Ship object reference type: String, year: int, builder: String): Ship public setName(aName: String): void public setType(aType: String): void public setYear(aYear: int): void public setBuilder(aBuilder: String): void Accepts a String object(local name:aBuilder) and assigns public getName: String public getYear(): int Accepts a String object local name:aName) and assigns it to the instance variable name Accepts a String objeclocal name:aType and assigns it to the instance variable type Accepts an int value(local name:aYear) and assigns it to the instance variable vear it to the instance variable builder Returns the current value of instance variable name Returns the current value of instance variable type Returns the current value of instance variable vear Returns the current value of instance variable builder ublic getType): String ublic getBuilder(): String Returns a formatted String containing a state report, that is, the current values of each of the objects instance variable public toString):String
    Purpose: To review defining a Class of objects, instantiating objects of that class, and calling methods of the instantiated object. Instructions: Write a Java class named Ship to meet the requirements described in the following UMLClass Diagram. Shi Attributes Name of the ship Type of the ship Year of build Builder company rivate name: Strin private type: String rivate year: int private builder: String Operations ceconstructor>> Ship): Shi

    Expert Answer

     
    Ship.java public class Ship {

    Need this program coded with the set-right quenchedput which is supposing. Programming speech is JAVA.

    Purpose: To re-examination defining a Assort of motives, instantiating motives of that assort, and pursuit regularitys of the instantiated motive. Instructions: Write a Java assort designated Ship to confront the requirements picturesquely in the aftercited UMLAssort Diagram. Shi Attributes Call of the ship Model of the ship Year of raise Raiseer aggregation rivate call: Strin retired model: String rivate year: int retired raiseer: String Operations ceconstructor>> Ship): Shi <<constructor» Ship(name: String, Default or empty parent Parent accepting foul-mouthed(4) parameters. Returns a abundantly formed and abundantly authoritative Ship motive regard model: String, year: int, raiseer: String): Ship exoteric setName(aName: String): empty exoteric setType(aType: String): empty exoteric setYear(aYear: int): empty exoteric setBuilder(aBuilder: String): empty Accepts a String motive(national call:aBuilder) and assigns exoteric getName: String exoteric getYear(): int Accepts a String motive national call:aName) and assigns it to the occurrence fickle call Accepts a String objecnational call:aModel and assigns it to the occurrence fickle model Accepts an int compute(national call:aYear) and assigns it to the occurrence fickle vear it to the occurrence fickle raiseer Returns the general compute of occurrence fickle call Returns the general compute of occurrence fickle model Returns the general compute of occurrence fickle vear Returns the general compute of occurrence fickle raiseer ublic getType): String ublic getBuilder(): String Returns a formatted String containing a avow fame, that is, the general computes of each of the motives occurrence fickle exoteric toString):String

    Purpose: To re-examination defining a Assort of motives, instantiating motives of that assort, and pursuit regularitys of the instantiated motive. Instructions: Write a Java assort designated Ship to confront the requirements picturesquely in the aftercited UMLAssort Diagram. Shi Attributes Call of the ship Model of the ship Year of raise Raiseer aggregation rivate call: Strin retired model: String rivate year: int retired raiseer: String Operations ceconstructor>> Ship): Shi

    Expert Rejoinder

     

    Ship.java

    exoteric assort Ship {

    //Declaring occurrence fickles
    retired String call;
    retired String model;
    retired int year;
    retired String raiseer;

    //Zero argumented parent
    exoteric Ship() {}

    //Parameterized parent
    exoteric Ship(String call, String model, int year, String raiseer) {
    this.call = call;
    this.model = model;
    this.year = year;
    this.constructor = raiseer;
    }

    //getters and setters
    exoteric definite String getName() {
    return call;
    }

    exoteric definite empty setName(String call) {
    this.call = call;
    }

    exoteric definite String getType() {
    return model;
    }

    exoteric definite empty setType(String model) {
    this.model = model;
    }

    exoteric definite int getYear() {
    return year;
    }

    exoteric definite empty setYear(int year) {
    this.year = year;
    }

    exoteric definite String getBuilder() {
    return raiseer;
    }

    exoteric empty setBuilder(String raiseer) {
    this.constructor = raiseer;
    }

    //toString regularity is used to expose the fluctuation of an motive within it
    @Override
    exoteric String toString() {
    return call + ” is a ” + model + ” built by ” + raiseer + ” in ” + year;
    }

    }

    ______________________

    TestShip.java

    exoteric assort TestShip {

    exoteric static empty ocean(String[] args) {

    //Creating couple ship assort motives
    Ship s1 = upstart Ship(“TI Oceania”, “Tanker”, 2003, “Daewoo Shipbuilding & Marine”);
    Ship s2 = upstart Ship(“Celebrity Equinox”, “Cruise”, 2009, “Meyer Werft”);

    //Displaying the Ship assort motive fluctuation within it
    System.out.println(s1.toString());
    System.out.println(s2.toString());

    }

    }

    _________________

    Output:

    TI Oceania is a Tanker built by Daewoo Shipbuilding & Marine in 2003
    Celebrity Equinox is a Cruise built by Meyer Werft in 2009