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 22:40
In this lab, you complete a python program that calculates an employee's annual bonus. input is an employee's first name, last name, salary, and numeric performance rating. if the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. if the rating is 4 or higher, the rate is 0. the employee bonus is calculated by multiplying the bonus rate by the annual salary.
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
What is the main benefit of minimizing the ribbon in word? more options will be accessible through customized keystrokes. more of the document will be viewable without needing to scroll. fewer controls will be accessible to the user by using the mouse. fewer editing options will be available without entering a password.
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
What does the level 1 topic in a word outline become in powerpoint? a. first-level bullet item b. slide title c. third-level bullet item d. second-level bullet item
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
You know the right answer?
JAVA ASSIGNMENT Understand the Problem
In our lectures, we learned that boolean functions can...
Questions
question
Biology, 24.06.2019 11:00
Questions on the website: 13722361