subject

JAVA ASSIGNMENT Understand the Problem
In our lectures, we learned that boolean functions can be fully described by an array of booleans, where the input of the function is the int index to the array, and the output is the boolean value stored in that index position. We are going to wrap such an array of booleans into a class called BooleanFunc (which, of course, stands for boolean function). This will represent a boolean function of any non-negative size and take precautionary measures that you would expect of a wrapper class that surrounds an unstructured type such as an array. Our goal will be to define the logic of a seven-segment display which is little more than seven boolean functions wrapped in a device that can be viewed visually.
We could do the entire project with two classes, BooleanFunc and SevenSegmentDisplay, but we will find that it is simpler to break the functionality of SevenSegmentDisplay into four classes, two of which we'll do this week (MultiSegmentLogicand SevenSegmentLogic) and two of which we'll do next week (SevenSegmentImage and SevenSegmentDisplay).
BooleanFunc will hold the truth table in a 1-D array of type boolean. As we know from the modules, this tells us what the output is for any integer input, and those integer inputs are the encoded binary bits going into the table. The class allows the instantiation of any non-negative size boolean function, and once instantiated, cannot be resized (no mutator for the table size), but it can be redefined (meaning the values of the function can be changed, or if the RHS of a clone()assignment, its reference will point to an object of a potentially different size). Of course, it protects itself against client abuse.
We will define a general base class called MultiSegmentLogic, which can be extended to cover a multi-segment display having any number of segments, but our intent is to extend it to cover a seven-segment display. We will be thinking in terms of the seven-segment display throughout the design of the class, but we'll design MultiSegmentLogic so that it could support a hypothetical 49-segment display, 1000-segment display or any other size the client wishes.
We will derive SevenSegmentLogic from MultiSegmentLogic, baking the specifics of a seven-segment display into this derived class.
MultiSegmentLogic, and SevenSegmentLogic are so named because they do the boolean logic of the displays, but do not actually produce any visual representation. This is not only more manageable (you would be hard pressed to do both the logic and the display in a single week), but is in keeping with the separation of interface and implementation.
Of course, we'll test our classes as we go, and you will demonstrate that your classes and methods work with a main() that tests the individual components.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
What are three software programs for mobile computing?
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
What is estimated time of arrival (eta)? a device that measures the acceleration (the rate of change of velocity) of an item and is used to track truck speeds or taxi cab speeds a gps technology adventure game that posts the longitude and latitude location for an item on the internet for users to find a north/south measurement of position the time of day of an expected arrival at a certain destination and is typically used for navigation applications
Answers: 3
question
Computers and Technology, 24.06.2019 02:00
What is a loop? a. a collection of function definitions at the top of a program b. a line of code that defines a variable and assigns it a value c. a program that opens the turtle graphics window d. a block of code that repeats a specific number of times
Answers: 1
You know the right answer?
JAVA ASSIGNMENT Understand the Problem
In our lectures, we learned that boolean functions can...
Questions
question
Mathematics, 11.10.2020 23:01