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

  Immune response to infectious disease

It is a very curcial concept to understand how the immune response is mounted against viruses, bacteria, protozoans and helminthes. For an effective immune response, both innate and adaptive immunity should work together.

  A review on advanced glycated end products (ages)

This Project report elaborates a critical review of important elements attached to Advanced Glycated End Products (AGEs). It is very crucial to understand the process called Millard reaction.

  Plastic as a soil stabilizer

Soil stabilization is the permanent physical and chemical alteration of soils to enhance their physical properties. Stabilization can increase the shear strength of a soil and control the shrink-swell properties.

  Principles of microbiology

This assignment has three parts which contains questions related to Microbiology. It contains basic principles of microscopy, staining techniques in microbiology and microbial growth in the food industry.

  List the biologic functions

Lipid metabolites are often seen as key elements in cellular signaling. Is this unique? Please provide several examples of the function of lipids as key elements in signal arrays and list the biologic functions these signals affect?

  Biologic function relationships

Please describe how one might search for chemical structure, biologic function relationships, involving small molecular weight lipophylic compounds. Provide one example.

  Case study on patient in the haematology laboratory

Write a case study which detailing a scenario of a patient being investigated in the Haematology laboratory.

  Use of pcr and genetic approaches in biotechnology

The use of PCR and genetic approaches in biotechnology

  Describe the role of this enzyme in honey

Glucose oxidase is an enzyme that can be used for measurements of glucose levels by combining this reaction with an oxygen probe.

  Genetic problems

What phenotypic ratio would you get if you crossed a white mouse and a heterozygous brown mouse?

  Prepare an essay on nosocomial infection

Prepare an essay on nosocomial infection.

  Monitoring and recording the blood pressure

To increase the awareness of monitoring and recording the blood pressure of patients and practice measuring blood pressure in a safe environment.

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