subject
Computers and Technology, 06.05.2020 00:08 punani

Write a Java program that meets the following requirements:

Create a class named Rock that acts as a superclass for rock samples collected and catalogued by a natural history museum. The Rock class contains fields for a number of samples, a description of the type of rock, and the weight of the rock in grams. Include a constructor that accepts parameters for the sample number and weight. The Rock constructor sets the description value to Unclassified. Include get methods for each field. Since you do not create any "Rock" objects make the Rock class abstract. Create three child classes named IgneousRock, SedimentaryRock, and MetamorphicRock. The constructors for these classes require parameters for the sample number and weight. Search the Web for a brief description of each rock type and assign it to the description field. Create an application that instantiates an object of each type and demonstrate that the methods work appropriately. Save the files as Rock. java, IgneousRock. java, SedimentaryRock. java, MetamorphicRock. java, and DemoRocks. java.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:40
When running anti-virus software , what could be a reason where recipitent is not guaranteed that data being streamed will not get interrupted?
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
What is the first view you place in your drawing?
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Quick pl which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
You know the right answer?
Write a Java program that meets the following requirements:

Create a class named Rock th...
Questions
question
History, 25.04.2020 08:09
question
Mathematics, 25.04.2020 08:09
question
Mathematics, 25.04.2020 08:09
question
Mathematics, 25.04.2020 08:09
question
Chemistry, 25.04.2020 08:09
question
History, 25.04.2020 08:09
Questions on the website: 13722367