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.
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?
|