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
Kisachek [45]
3 years ago
6

a) Write out an abstract class to represent a ball. Include data fields to store the weight of the ball as a double value and th

e color of the ball as a String. Include a no-arg constructor as well as a two-arg constructor to set these two fields. Declare an abstract method, howToPlay(), which is to describe how the ball is used by printing this description to the command line.
Computers and Technology
2 answers:
guapka [62]3 years ago
7 0

Answer:

Check the explanation

Explanation:

//Ball.java

public abstract class Ball {

   double value;

   String color;

   public Ball() {

   }

   public Ball(double value, String color) {

       this.value = value;

       this.color = color;

   }

   public abstract void howToPlay();

}

////////////////////////////////////////////

//SoccerBall.java

public class SoccerBall extends Ball {

   public void howToPlay() {

       System.out.println("Description to how to play soccer ball");

   }

}

Lyrx [107]3 years ago
3 0

Answer:

See explaination

Explanation:

Code

abstract class Ball

{

double weight;

String color;

Ball()

{

this.weight=0;

this.color=" ";

System.out.println("Abstract class constructor");

}

Ball(double weight,String color)

{

this.weight=weight;

this.color=color;

System.out.println("Parameterized constructor of Abstract class with weight = "+weight+" color = "+color);

}

public abstract void howToPlay();

}

public class Baseball extends Ball {

int no;

String name;

int bat,hi ts;

Baseball() {

super(20,"red");

System.out.println("BaseBall class Constructor");

}

Baseball(int no,String name,int bat,int hi ts)

{

this.no=no;

this.name=name;

this.bat=bat;

this.hi ts=hi ts;

}

public void howToPlay()

{

System.out.println("How to play method weight = "+weight+ " color = "+color);

}

public void display()

{

System.out.println("Player no: "+no+" name = "+name+" numberAtbat = "+bat+" hi ts = "+hit s);

}

public static void main(String[] args) {

Baseball ob j = new Baseball();

Baseball ob j1 = new Baseball(1,"abc",1,3);

ob j.howToPlay();

ob j1.display();

}

}

You might be interested in
When all the system testing and bugs correction has done, the software product will be delivered to the user for __________.
Alecsey [184]

Answer:

use and feedback

Explanation:

Once this is completed the software product is delivered to the user for use and feedback. If both testing and bug corrections have been completed it means that the product is finalized and working as intended. Once this is the case, all that is left for a development team to do is deliver the final product to the end-user for them to use and give their feedback as to how they like the product. Many times this feedback can restart the testing and bug correction phase once again if the development team decides to add new features.

4 0
3 years ago
Consider the concept of cultural lag. Identify two American values that are “lagging.” What are three norms that are lagging? Ho
shepuryov [24]

Answer:

The cultural lag describes what actually takes place in the social system when the ideals that governs the society are not able to keep pace with the advances that are most of the time, but not actually always the technological advances. There norms are life support, stem cell research and findings, and cancer vaccines when we deal with American society, which is quite the fastest to keep pace with the technological advancement in general. Its possible now technologically to keep a person alive than he normally lives, but society still needs to accept this. The others are similar, and hence the other two norms. United States is a developed civilization, however still the life after death has not been accepted, however, extended life is definitely a possibility now. Its is quite expected however that soon it is going to be accepted. Hence, its a matter of time only, but since it has been not accepted till now it is a cultural lag. Stem cell research is also a similar situation. But soon it will be accepted as well.  Hence, US can be supposed to be the most advanced society, and the above cultural lags are for the time being only, and soon will be accepted. None of the other countries, you can expect these to be accepted currently. That is why US is the most advanced society of the world. However, some ethical conflicts and crisis still exist, but it will be removed soon, which is expected.

Explanation:

The answer is self explanatory.

7 0
3 years ago
Building relationships during your career exploration is called?
djyliett [7]
This is called


C. Networking
4 0
3 years ago
Write a program that can add, Subtract, multiply and divide entered numbers. <br>​
solniwko [45]

In Python:

def add(x, y):

   return x + y

def subtract(x, y):

   return x - y

def multiply(x, y):

   return x * y

def divide(x, y):

  return x / y

8 0
3 years ago
In 5-10 sentences, describe the procedure for responding to an e-mail message.
miss Akunina [59]

Answer: See explanation

Explanation:

The procedure fur responding to an email message goes thus:

The first thing to do is to open the website of the email. Then, you would click on "compose".

When you click on compose, you'll see some space where you'll fill some information such as the email of the person that you're sending to, that is, the receiver. You'll also feel the subject of the email.

Then you type the content of your message. When you're done with this, then you click on send.

7 0
2 years ago
Other questions:
  • Write a program totake a depth (in kilometers) inside the earth as input data;compute
    15·1 answer
  • A bitmap picture can be represented by hexadecimal numbers. Each two-digit hexadecimal number represents a row. To convert a num
    14·1 answer
  • Diagnosing is solving the problem, and trouble shooting is figuring out what the problem is.
    15·1 answer
  • Write a program that reads a target string from the keyboard and then another sentence string from the keyboard.
    10·1 answer
  • Type the correct answer in the box.
    15·1 answer
  • Graphic design includes typefaces, page layouts, corporate logos, and product packaging. Which modern graphic designer is best k
    14·2 answers
  • Jeremy Aronoff has purchased a new laptop. He wants to customize the operating system to meet his
    7·1 answer
  • Which of these is an aggregator?
    9·2 answers
  • If anyone gotta ps4, i'm a 15 yr old female n if u wanna b frens, hmu :))
    8·2 answers
  • WHATS YALL FAVORITE GAME WHOEVER GIVES THE BEST ANSWER WINS 200
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!