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

Previous Q& A

  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?

  What do you mean by the term foreign exchange

What do you mean by the term "foreign exchange"? How can we determine foreign exchange rate? Discuss the theories in brief and Outline the differences between a ‘market' and a ‘Financial Market'. Explain the features of a financial market.

  An assignment in it

An assignment in IT. I need to write 3 pages about Transaction Payment System . In this 3 pages, I need to find an problem about it and write the solution of it. I found some articles which could be helpful.

  Current situation between the gcc countries and yemen

Write a summery of 500 words on the topic of Current Situation between the GCC countries and Yemen with proper references.

  Differences between financial and managerial accounting

differences between financial and managerial accounting

  Differentiate between a two-tier client/server

Differentiate between a two-tier client/server system and a three-tier client/server system.  Differentiate between a fat client and a thin client.  Why would a firm choose one of these approaches over the other when implementing a client/server syst..

  Regarded as one of the most controversial pieces

1.Why may the Sarbanes Oxley Act of 2002 be regarded as one of the most controversial pieces of corporate legislation in recent history?

Reviews

Write a Review

 

Similar Q& A

  Hospital-acquired infection and outbreakshospital-acquired

hospital-acquired infection and outbreakshospital-acquired nosocomial or infection infection is not a new concept.

  Show greater suspectibility to pathogens

It is Known that the Pentuple ACS Mutant is known to show greater suspectibility to pathogens, ACS is also responsible forACC to ethylene conversion.

  Filamentous component of the cytoplasm

The formation of surface blebs caused by ischemia reflects in part plasma membrane injury, but also a sign of cytoplasmic injury.

  Different processed meat items

For two different processed meat items, describe how the processing and ingredients should or shouldn’t be the same or different. For the two items, explain why it would be beneficial or detrimental to use hot boned meat, comminuted meat, injected me..

  What are these two kinds of dna

There are a number of natural types of DNA. One is animal DNA, one plant DNA, another bacterial DNA.What are these two kinds of DNA.

  What does bacteria cells have that plant and animal cells

What does bacteria cells have that plant and animal cells don't? What does animal cells have that bacteria and plant cells don't? What do plant cells have that animal and bacteria cells don't? What do all three have in common?

  Why is fatty acid catabolism dependent on an adequate

explain the molecular basis for the adage: "Fats burn in the flame of carbohydrates" in other words, why is fatty acid catabolism dependent on an adequate supply of carbohydrates in our diet?

  Q1 dynein is missing from cilia amp flagella of individuals

q1. dynein is missing from cilia amp flagella of individuals with a specific inherited disorder. these individuals have

  What are the genotypic and phenotypic ratios

A friend claims that the faster you read, more you remember. Use your information of effortful processing and effective encoding strategies to refute your friend's claim.

  Q1 mr simpsons father and mrs simpson brother each have the

q1. mr. simpsons father and mrs. simpson brother each have the same rare autosomal recessive disorder. mr. and mrs.

  Compare and contrast the pathognomic signs of cell death

If the cell cannot recover from injury, the damage is irreversible and cell death is the result. Define, compare and contrast the 3 pathognomic signs of cell death.

  What are the easiest microbial forms to kill or inhibit

Which of the microbial forms have the highest resistance to physical and chemical controls?

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