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
The following program uses a variable workHoursPerWeek rather than directly using 40 in the salary calculation expression.
Serjik [45]

Answer:

<u> Initial program output (from original program)</u>

Annual salary is: 40000

Monthly salary is: 3333

<u>Program output after workHoursPerWeek = 35</u>

Annual salary is: 35000

Monthly salary is: 2916

<u>Revised program (using variable workWeeksPerYear)</u>

  1.    public static void main(String[] args) {
  2.        int hourlyWage = 20;
  3.        int workHoursPerWeek = 35;
  4.        int workWeeksPerYear = 52;
  5.        int annualSalary = 0;
  6.        annualSalary = hourlyWage * workHoursPerWeek * workWeeksPerYear;
  7.        System.out.print("Annual salary is: ");
  8.        System.out.println(annualSalary);
  9.        System.out.print("Monthly salary is: ");
  10.        System.out.println((hourlyWage * workHoursPerWeek * workWeeksPerYear) / 12);
  11.        return;
  12.    }

Program output:

Annual salary is: 36400

Monthly salary is: 3033

<u>Revised Program after introducing monthly salary</u>

  1.    public static void main(String[] args) {
  2.        int hourlyWage = 20;
  3.        int workHoursPerWeek = 35;
  4.        int workWeeksPerYear = 52;
  5.        int annualSalary = 0;
  6.        int monthlySalary = 0;
  7.        
  8.        annualSalary = hourlyWage * workHoursPerWeek * workWeeksPerYear;
  9.        monthlySalary = hourlyWage * workHoursPerWeek * workWeeksPerYear;
  10.        
  11.        System.out.print("Annual salary is: ");
  12.        System.out.println(annualSalary);
  13.        System.out.print("Monthly salary is: ");
  14.        System.out.println((monthlySalary) / 12);
  15.        return;
  16.    }

Explanation:

One reason to use variable to replace the magic number is to improve the readability of the program. If we compared the revised version of the program with the original program, we will find that the variable enable our code easier to understand.

Besides, if we wish to change the value (e.g. working hours per year or per month), we just need to adjust the value assigned on the variables. The variables provide a single access point to get or change the value.

7 0
3 years ago
What does the chart elements option allow you to change
S_A_V [24]
You can change the format of individual chart elements, such as the chart area, plot area, data series, axes, titles, data labels, or legend.


5 0
3 years ago
Read 2 more answers
Match each word to its correct meaning.
monitta

Answer:

1. Graphics.

2. Clip art.

Explanation:

1. Graphics: visual representations of information that are not text-images, photos, symbols, diagrams, and so on. Some examples of software applications used for graphics design are CorelDraw, Adobe Illustrator, Affinity Designer, Inkscape, Adobe Photoshop, etc.

Adobe Photoshop is a proprietary software application designed and developed by Adobe inc. for both Windows and MacOS operating system. It is a raster graphics editor that's typically used for imaging and graphics design. It comprises of various shape tools such as ellipse, line, polygon, triangle, custom shape and rectangle.

2. Clip art: digital artwork such as symbols and pictures that can be imported for use in documents or other software applications.

7 0
3 years ago
How did mechanical clocks assist in completing work? How was work done previously?
lozanna [386]

Answer

Timekeeping has been a part of society since Ancient Egypt. The use of spring-powered mechanisms allowed clocks to be made smaller ... Essentially, the church bells and the mechanical clock now became the monitor of the working day.

Explanation:

4 0
3 years ago
Ssume the following variables contain the values shown: numberRed = 100 numberBlue = 200 numberGreen = 300 wordRed = "Wagon" wor
brilliants [131]

Answer:

  1. numberRed = numberBlue   = FALSE
  2. numberBlue > numberGreen  = FALSE
  3. numberGreen < numberRed   = FALSE
  4. numberBlue = wordBlue   = ILLEGAL
  5. numberGreen = "Green"   = FALSE
  6. wordRed = "Red"     = FALSE  
  7. wordBlue = "Blue"     = FALSE
  8. numberRed <= numberGreen  = TRUE
  9. numberBlue >= 200    = TRUE
  10. numberGreen >= numberRed + numberBlue = TRUE
  11. numberRed > numberBlue AND numberBlue < numberGreen = FALSE
  12. numberRed = 100 OR numberRed > numberBlue   = TRUE
  13. numberGreen < 10 OR numberBlue > 10     = FALSE
  14. numberBlue = 30 AND numberGreen = 300 OR numberRed = 200 = FALSE

Explanation:

THESE RESULTS ARE VERIFIRED.....

6 0
4 years ago
Other questions:
  • How does sea floor spreading relate to supercontinents? A. It lowers the overall water level in the ocean so land masses can joi
    13·2 answers
  • Convert 4.5 strides to girth
    10·1 answer
  • Which statement regarding killers is true?
    12·2 answers
  • The processor of a computer communicates to the other parts of the computer through a code that consists of what?
    9·1 answer
  • Computers have small bumps on the keyboards that enable persons to type without looking at the keyboard. These letters are:
    6·2 answers
  • List safety conditions when downloading shareware, free free where, or public domain software
    14·1 answer
  • Think about that the C, B and S parameters of a Cache. Think about what happens to compulsory, capacity, conflict misses, if onl
    7·1 answer
  • 1 cup coffee cream = ____ tbsp butter plus ____ c milk
    11·1 answer
  • Output is the act of is the act of entering the data to the computer?​
    10·1 answer
  • Dentify the benefits of workplace diversity. Select all that apply.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!