1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ddd [48]
4 years ago
6

Design an abstract Ship class that the following members:  A field for the name of the ship (a string).  A field for the year

that the ship was built (an integer).  A constructor and appropriate accessors and mutators.  A toString method that displays the ship’s name and the year it was built.
Computers and Technology
1 answer:
Levart [38]4 years ago
3 0

Answer:

Due to error while posting the answer, the code snippet is attached as pdf file

Explanation:

The code is written in Java and it is an abstract class.

It starts by defining abstract class with the keyword "abstract".

Then it declare two field for shipName and shipYear.

Then a two arguments constructor is defined.

After that the setter and getter method is declared. The getter and setter is also known as accessor and mutator.

Then a String representation of Ship objects is done by overriding the to String method.

Download pdf
You might be interested in
System memory is on a computer motherboard?
Leya [2.2K]
Is this a true or fales question

8 0
3 years ago
Read 2 more answers
Carlos owns a hardware store. He currently is not using any software to track what he has in the store. In 1–2 sentences, descri
Tresset [83]

Carlos Should use a Security Camera to keep track of his physical hardware. Carlos can then use a computer to monitor the security cameras.

7 0
3 years ago
Read 2 more answers
Write a loop that reads strings from standard input where the string is either "land", "air", or "water". The loop terminates wh
Setler79 [48]

The loop terminates when "xxxxx" is read in. If the word is land, the string followed by "land" get outputted. The same with air, and water.

Explanation:

int land = 0;

int air = 0;

int water = 0;

String word = "";

while(!(word.equals("xxxxx"))) {

word = stdin.next();

if(word.equals("land")) {

   land++;

}else if(word.equals("air")) {

   air++;

}else if(word.equals("water")) {

   water++;

}  

}

System.out.println("land:" + land);

System.out.println("air:" + air);

System.out.println("water:" + water);

5 0
3 years ago
Which command executed in Windows PE would transfer both the files and directory structure from one device to another device or
EleoNora [17]

Answer:

xcopy

Explanation:

xcopy (which stands for extended copy) command, was created to have several functions and ability to copy one or more folders, files or an entire directory from one location to another. It is more powerful than copy command that was seen in the first set of operating systems. It is currently being built into desktop operating systems and Microsoft windows server.

6 0
3 years ago
How can you tell if your car is overheating?
Nitella [24]
A) your temp gauge is moving into red
4 0
3 years ago
Read 2 more answers
Other questions:
  • Questions 6 - 9 Refer to the following code: public class WhatsIt { private int[] values; private double average; public WhatsIt
    7·1 answer
  • Vpns create a _____________ to transport information through public communications media.
    8·1 answer
  • The house had a wonderful pool of ... (his/its/our) own.​
    5·1 answer
  • Why is self-esteem important in self-representation
    7·1 answer
  • Slicing can best be described as
    9·1 answer
  • The most complex part of ssl is the ___________ protocol.
    7·2 answers
  • In C please:
    5·1 answer
  • Which information purpose uses video from a security camera?
    15·1 answer
  • Which of the following describes the line spacing feature? Select all that apply. adds space between words adds space between li
    8·1 answer
  • How does Shakespeare immediately introduce Tybalt as a menacing character?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!