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
gizmo_the_mogwai [7]
3 years ago
12

11) Write the definition for a child class of Circle named Cylinder. The cylinder should have a double attribute named height. T

he constructor of the child class should take parameters to initialize the attributes. The class Cylinder should also include getter and setter method as well as an equals method that returns true if two cylinder objects have same dimensions and false otherwise. Remember to override method where needed.
Computers and Technology
1 answer:
insens350 [35]3 years ago
8 0

Answer:

See explaination

Explanation:

//Cylinder.java

public class Cylinder extends Circle {

private double height;

public Cylinder(double h, double r) {

super(r);

setHeight(h);

}

public double getHeight() {

return height;

}

public void setHeight(double height) {

this.height = height;

}

public boolean equals(Object o) {

if (this == o) return true;

if (!(o instanceof Cylinder)) return false;

Cylinder cylinder = (Cylinder) o;

return Double.compare(cylinder.height, height) == 0 && Double.compare(cylinder.radius, radius) == 0;

}

}

You might be interested in
You have a large company, and it is important to your business that your employees' work is backed up regularly. Which network w
valkas [14]
Client server network as it has a powerful server which provides all the networks required on the network. Files are usually backed up regularly.

3 0
4 years ago
Which option offers predesiged formatting and design elements to facilitate the process of creating a document?
Mrrafil [7]
Templates......hope this helps you
5 0
3 years ago
How many bytes are in 1 kilobyte of storage
topjm [15]

Answer:

1000

Explanation I SEARCHED IT Up

5 0
4 years ago
1.) An education application would most likely do which of the following?
77julia77 [94]
The answer would be D teach a new language.
3 0
4 years ago
Read 2 more answers
The Fibonacci numbers are a sequence of integers in which the first two elements are 1, and each following element is the sum of
ioda

Answer:

// program in java to print 12 fibonacci terms

// package

import java.util.*;

// class definition

class Main

{

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

     

      // variables

      int no_of_term=12, f_term = 1, s_term = 1, n_term = 0;

      System.out.print("First 12 term of Fibonacci Series:");

      // print 12 terms of the Series

       for (int x = 1; x<= no_of_term; x++)

           {

       // Prints the first two terms.

            if(x <=2 )

            System.out.print(1+" ");

            else

            {

               // find the next term

                n_term = f_term + s_term;

                // update the last two terms

                f_term = s_term;

                s_term = n_term;

                // print the next term

              System.out.print(n_term+" ");

            }

           }

     

     

   }catch(Exception ex){

       return;}

}

}

Explanation:

Declare and initialize no_of_term=12,f_term=1,s_term=1 and n_term=0.Run a loop  for 12 times, for first term print 1 and then next term will be calculated as  sum of previous two term of Series.Then update previous two term.This will  continue for 12 time and print the terms of Fibonacci Series.

Output:

First 12 term of Fibonacci Series:1 1 2 3 5 8 13 21 34 55 89 144

4 0
3 years ago
Other questions:
  • Damian uses a modem to connect to a dial-up network. Which statements are true of a modem?
    11·2 answers
  • How many times will the while loop that follows be executed? var months = 5; var i = 1; while (i &lt; months) { futureValue = fu
    12·1 answer
  • Click/press _______ to remove the most recently typed text.
    12·2 answers
  • Pls help!!!!!!!!!!!!
    13·2 answers
  • Here we have a program which is calling the subtract function to calculate the difference between two numbers. The value from th
    7·1 answer
  • Please answer<br><br>NO LINKS​
    7·1 answer
  • May I ask, when you accidently drop your laptop into a pool,...(water) . Will the Data and Many other information... inside the
    5·2 answers
  • Imagery functions as a coding system to help individuals acquire movement patterns. this describes
    6·1 answer
  • To improve readability and maintainability, you should declare ________ instead of using literal values such as 3.14159.
    14·1 answer
  • Which of the following was the first computer-animated film to win animated film to win an academy award?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!