Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Biology Expert

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 add other data if you like. Make sure to provide appropriate access methods for your data. You must validate the data as:

  • Number of legs must be greater than or equal to one, and less than or equal to six
  • Shape can only be "round", "oval", or "rectangular".
  • The surface area must be greater than or equql to 4 square feet, and less than or equal to 50 square feet
  • Base price must be greater than zero.
  • Wood can only be "oak", "cherry", "mahogany", "pine".
  • If you add other instance variables, you must validate them with reasonable values. Justify those values in your comments.

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 additional cost calculated from the following function:

additional$ = 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 additional 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.

Biology, Academics

  • Category:- Biology
  • Reference No.:- M91544301
  • Price:- $20

Guranteed 24 Hours Delivery, In Price:- $20

Have any Question?


Related Questions in Biology

Duchenne muscular dystrophy md is a recessive sex-linked

Duchenne muscular dystrophy (md) is a recessive, sex-linked inherited disease in humans. A cross between a normal man and a woman who is a carrier of this trait, what are the odds that a sons or daughters would have MD? ...

The current scientific defination of standard temp and

The current scientific defination of standard temp and pressure (STP) is: 0 degrees C and 1.00 bar pressure of a gas, using ideal gas law calculate the volume In L occupied by 1 mol of an ideal gas under these condition( ...

Is the iso-osmotic point different for different solutes

Is the iso-osmotic point different for different solutes? Please specify in what ways can the iso-osmotic points be different and why there is a difference.

1 is a vitamin that sunlight on the skin typically

1. __________ is a vitamin that sunlight on the skin typically triggers within the body. 2. The specific cell type that produces bone tissue is called _____________. 3. The four components of a negative feedback loop ___ ...

Choose one of the areas mentioned above that you would like

Choose ONE of the areas mentioned above that you would like to learn more about and write two or three paragraphs describing the process and how it relates to metabolism within the cell. Provide at least one specific (na ...

Why were there no large mammals around when the dinosaurs

Why were there no large mammals around when the dinosaurs occupied the land?

Lab assignment -for this assignment you need to document

Lab Assignment - For this assignment you need to document the anatomy you see in the grass frog dissection. USE THE NAME SECTION TASEW GIRMA. Experiment 1: Owl Pellet Dissection 1) Include a photograph to accompany your ...

John is a 53-year old contraction worker who has come into

John is a 53-year old contractIon worker who has come into your office complaining of a sore knee joint. You see a buildup fluid close to the patella (kneecap) but deep to the skin and suspect the soreness is due to burs ...

What problems does this traditional classification scheme

What problems does this traditional classification scheme of protists create in our understanding of the evolutionary relationships that exist between protists?

Trace the flow of carbon within the process of

Trace the flow of carbon within the process of photosynthesis. Be sure to include the following terms in your description: Glucose.NADPH,ATP, Calvin cycle, RUBISCO,CO2.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As