Question: Project Outcomes: Develop a Java program that 1. Uses selection constructs (if, and if else). Uses the Java iteration constructs (while, do, for). 2. 4.



Project Outcomes: Develop a Java program that 1. Uses selection constructs (if, and if else). Uses the Java iteration constructs (while, do, for). 2. 4. 3. Uses static variables. Ensure integer variables input are within a range that will not cause integer overflow Uses proper design techniques including reading UML Class Diagrams 5. Project Requirements: 1) Develop a Fence class: a. Fence structure i. ii. The frame of the fence is represented by pound sign (#). The fence bars are represented by vertical bar character or pipe, as it is called. (pipe is above the back splash on most keyboards). Place one space to left and right of the fence bars. See sample run below. iii. iv. b. fenceCount a static integer variable that represents the number of fence object created in a given run of the program. c. Instance variables height-an integer representing the height of the fence ii. i. width - an integer representing the width of the fence d. Constructors - Default (no parameter constructor) i. sets the instance variables and static variable to zero ii. Note the program will use mutator methods to change fence's height and width to values other than zero. e. Methods i. getHeight - returns the fence's height. ii. get Width returns the fence's width iii. setHeight (int newHeight) 1. 2. 3. Changes the value of the fence's height Ensures the height is within a range of 2 to 5. Returns a boolean true - indicating height is within range and height is set to parameter value. false - indicating height not in range and height instance variable unchanged. a. b. iv. set Width (int newWidth) 1. Changes the value of the fence's width 2. 3. Ensures the height is within a range of 3 to 24. Returns a boolean true -indicating width is within range and width is set to parameter value. a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
