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 punish extinguishedput which is supposing. Programming vernacular is JAVA.

    Purpose: To reconsideration defining a Rank of intents, instantiating intents of that rank, and pursuit ways of the instantiated intent. Instructions: Write a Java rank calld Ship to coalesce the requirements forcible in the aftercited UMLRank Diagram. Shi Attributes Call of the ship Mold of the ship Year of establish Establisher troop rivate call: Strin privy mold: String rivate year: int privy establisher: String Operations ceconstructor>> Ship): Shi <<constructor» Ship(name: String, Default or vain committer Committer accepting impure(4) parameters. Returns a abundantly formed and abundantly authoritative Ship intent allusion mold: String, year: int, establisher: String): Ship exoteric setName(aName: String): unfilled exoteric setType(aType: String): unfilled exoteric setYear(aYear: int): unfilled exoteric setBuilder(aBuilder: String): unfilled Accepts a String intent(topical call:aBuilder) and assigns exoteric getName: String exoteric getYear(): int Accepts a String intent topical call:aName) and assigns it to the example changeable call Accepts a String intentopical call:aMold and assigns it to the example changeable mold Accepts an int appraise(topical call:aYear) and assigns it to the example changeable vear it to the example changeable establisher Returns the general appraise of example changeable call Returns the general appraise of example changeable mold Returns the general appraise of example changeable vear Returns the general appraise of example changeable establisher ublic getType): String ublic getBuilder(): String Returns a formatted String containing a say description, that is, the general appraises of each of the intents example changeable exoteric toString):String

    Purpose: To reconsideration defining a Rank of intents, instantiating intents of that rank, and pursuit ways of the instantiated intent. Instructions: Write a Java rank calld Ship to coalesce the requirements forcible in the aftercited UMLRank Diagram. Shi Attributes Call of the ship Mold of the ship Year of establish Establisher troop rivate call: Strin privy mold: String rivate year: int privy establisher: String Operations ceconstructor>> Ship): Shi

    Expert Apology

     

    Ship.java

    exoteric rank Ship {

    //Declaring example changeables
    privy String call;
    privy String mold;
    privy int year;
    privy String establisher;

    //Zero argumented committer
    exoteric Ship() {}

    //Parameterized committer
    exoteric Ship(String call, String mold, int year, String establisher) {
    this.call = call;
    this.mold = mold;
    this.year = year;
    this.surveyor = establisher;
    }

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

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

    exoteric definite String getType() {
    return mold;
    }

    exoteric definite unfilled setType(String mold) {
    this.mold = mold;
    }

    exoteric definite int getYear() {
    return year;
    }

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

    exoteric definite String getBuilder() {
    return establisher;
    }

    exoteric unfilled setBuilder(String establisher) {
    this.surveyor = establisher;
    }

    //toString way is used to evince the space of an intent internally it
    @Override
    exoteric String toString() {
    return call + ” is a ” + mold + ” built by ” + establisher + ” in ” + year;
    }

    }

    ______________________

    TestShip.java

    exoteric rank TestShip {

    exoteric static unfilled deep(String[] args) {

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

    //Displaying the Ship rank intent space internally 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