Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions