Use appropriate instance varibles

Assignment Help Biology
Reference no: EM13875777

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.

Reference no: EM13875777

Questions Cloud

Effective deterrent to unethical business practices : The FCPA has too many exceptions to be an effective deterrent to unethical business practices.Do you agree or disagree with this statement?
Point of application on plate : The point of application on the plate of the smallest force F that is equivalent to the given system, The magnitude and direction of F.
Operating system overview : Conducting independent research, please write a 2-3 page paper providing an overview of operating systems.  In particular, indentify the role of an operating system, methods common to all standard operating systems, and a list of common or most popul..
The federal sentencing guidelines : 1.What issues prompted the revision of the Federal Sentencing Guidelines for Organizations in 2004?
Use appropriate instance varibles : 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 ..
Hash table contains tablesize positions : If a hash table contains tablesize positions and n records currently occupy the table, the load factor lf is defined as n/tablesize. Suppose a hash function uniformly distributes n keys over the tablesize positions of the table and lf is the load fac..
Ceos and cfos sign off on their company accounts : Do you think the requirement that CEOs and CFOs sign off on their company accounts will increase investor confidence in those accounts? Why or why not?
Mass moment of inertia of the plate : A thin semicircular plate has a radius a and a mass m. Determine the mass moment of inertia of the plate with respect to
What are four types of sbus and what are the goals of each : Name two types of organizational design and explain how they differ. What are four types of SBUs, and what are the goals of each?

Reviews

Write a Review

Biology Questions & Answers

  Discussion on biology

Biotechnology permits the use of living organisms or their processes for human needs or purposes. Currently, this topic includes such general examples as cloning,

  Q1 imagine that you perform fruit fly crosses with

q1. imagine that you perform fruit fly crosses with dissimilar pairs of three x-linked traits specified by genes x y

  How many molecules of histone h1 will be found

a stretch of DNA 2060 nucleotide-pairs in length is packed into nucleosomes in chromatin. Each nucleosome has 146 base pairsof DNA wrapped around it, and there are 60 base pairs of linker DNA between nucleosomes. How many molecules of Histone H1 w..

  Difference between competitive vs non-competitive inhibition

Difference between Competitive vs Non-competitive inhibition

  What is the probability that this child will be a boy

A couple has one girl and is expecting a second child. What is the probability that this child will also be a girl?

  Why would the physician order a test in the spinal region

When a physician does a spinal tap to look for meningitis, what structures will that needle pierce from the most superficial to the deepest. Why would the physician order a test in the spinal region to check a problem in the head?

  Q1 a how are bacteria cells adapted to live in the hypnotic

q1. a. how are bacteria cells adapted to live in the hypnotic environment?b. how are amoebas protozons adapted to live

  How many atp equivalents are produced by complete oxidation

How many ATP equivalents (assuming GTP=ATP) are produced by the complete oxidation of acetoacetate to CO2 and water?

  Describe the principles of dominance, segregation

Describe the principles of dominance, segregation, and independent assortment, based on Mendel's experiments. answer in at least 150 words.

  How are mammals characterized according

Mammal identity card. How are mammals characterized according to examples of representing beings, basic morphology, skin, respiration, circulation, nitrogen waste, thermal control and types of reproduction?

  What is the equilibrium frequency of the r allele

Application of an insecticide to control mosquito populations in malaria infested areas quickly resulted in a dominant mutation, R, resulting in insecticide resistance.

  Whether an inhibitor of an enzyme reaction is a competitive

Describe how you would determine whether an inhibitor of an enzyme reaction is a competitive or noncompetitive inhibitor.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd