Question: Create a class named Painting that contains fields for a paintings title, artist, medium (such as water color), price, and gallery commission. Create a constructor

Create a class named Painting that contains fields for a paintings title, artist, medium (such as water color), price, and gallery commission. Create a constructor that initializes each field to an appropriate default value, and create instance methods that get and set the fields for title, artist, medium, and price. The gallery commission field cannot be set from outside the class; it is computed as 20 percent of the price each time the price is set. Save the class as Painting.java. Create a class named TestPainting whose main() method declares three Painting items. Create a method that prompts the user for and accepts values for two of the Painting objects, and leave the third with the default values supplied by the constructor. Then display each completed object. Finally, display a message that explains the gallery commission rate. Save the application as TestPainting.java

Create a class named Painting that contains fields for a paintings title,

The program output should look like the example below. . Command Prompt F:\JavaBatchFile>javac Painting.java F:\JavaBatchFile>javac TestPainting.java F:\JavaBatchFile>java TestPainting The oil painting named Starry Night by Van Gogh sells for $2000000.0 and the gallery makes $490000.0 commission The crayon painting named My Dog by Billy Thompson sells for $5.0 and the gallery makes $1.0 commission The null painting named null by null sells for $e. and the gallery makes $0.8 commission The gallery commission rate is 28.8 percent F:\JavaBatchFile>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!