Question: You will write two separate classes. A Captain class that will allow us to create captains for boats and a CaptainTester class (partially complete) that

 You will write two separate classes. A Captain class that willallow us to create captains for boats and a CaptainTester class (partially

You will write two separate classes. A Captain class that will allow us to create captains for boats and a CaptainTester class (partially complete) that we will use to test some of our Captain class methods. The Captain class will also be unit tested. The Captain class diagram is below; you cannot create more public methods than the ones on the diagram. Captain - age: int -name: String - yearsOfExperience: int - registryNumber: int + Captain(int, String, int, int) + getName(): String + getYearsOfExperience(): int + equals(Captain): boolean + toString: String Captain(int, String,int,int): Creates a new captain given an age, name, years of experience and registry number on that order. equals(Captain): This is the simplified version of equals (we are received a Captain object). Two captains are the same if they have the same name and the same registry number. toString(): returns a String according to the example below (Captain's name is Christian Williams): Christian Williams, age: 77 YOE: 50 Registry: 8974 m Captain.java Captain Tester.java New Full Screen 3 Create a captain object using the variables and print ito 4 */ 5 6- import java.util.Scanner; 7 8- public class CaptainTester { 9- public static void main(String[] args) { 10 Scanner kb new Scanner(System.in); 11 String name kb.nextLine(); 12 kb.nextInt(); 13 int yearsOfExperience kb.nextInt(); 14 int registry kb.nextInt(); 15 16 //Create the captain Object here 17 18 19 //Print the captain object here using toString 20 int age ==

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!