Write a Java class called Table in a file called Table.java. You must allow a Table class object to store the shape of table (round, oval, rectangular), the number of legs, the base price per table, the surface area in square feet, and the wood. Use appropriate instance varibles for those. You can aID other data if you like. Make sure to provide appropriate access methods for your data. You must validate the data as:
Your table class must have a cost method that can be called to calculate and return a double with the final cost of the table. The final cost is the base price with an aIDitional cost calculated from the following function:
aIDitional$ = ft2 * wood$ + shape% * base
The wood$ (wood cost) per square foot is $1.00 for pine, $1.30 for oak, $1.60 for cherry, and $1.90 for mahogany. You may assume that these prices are constant and will never change. The shape% (percent aIDitional for special shapes) are 0% for rectangular, 20% for round, and 40% for oval. You may assume that these percentages will never change.
Thus, as an example, if the base price of a round, cherry table of 10 square feet is $100, then the final price should be $100 + 10 * 1.60 + 0.2 * 100 = $136.
Note: the figure at the end shows program operation with several input.
LDR 3302-21.01.01-1A24-S1, Organizational Theory and Behavior Unit III Essay Top of Form Bottom of Form…
Chapter 9 What are teratogens? Give 5 examples. Define each of these stages: Germinal, embryonic,…
You are a Financial Analyst that has been appointed to lead a team in the…
You are familiar with the ANA Code of Ethics and have a growing understanding of…
This week’s discussion will focus on management decision-making and control in two companies, American corporation…
Mary Rowlandson felt that the man who eventually came to own her, Quinnapin, was “the…