Based on the class diagram given write the class and interfa
Based on the class diagram given, write the class and interface definitions for all classes and interfaces in the diagram. Write the application program to test the classes. Your program should be able to display all the attributes of each object (one object for each class).
class Re Mode quirements Customer customer Name: String total Pay: doub bu Item: Readingtem Customerstring): Vold buy Reading tem) vold getTotalPay0 double toString0 String In e face GST Chargeable RATE 0.06: double adonly get GSTCharge 50 double Encyclopedia vold Encyclopedia(Sting, double. Inty:void kabaracte Readingitem e: S tring pice: double Reading tem 0: void Reading em double. Sting) :vold getName 0: void getPnce0 double abstract calculatePrice 0: double abstract displayin 0: Volo Magazine Magazine 0:void Magazine (int, Int, double, Sting): Vold author. String Book 0: Vold Book(Sting double. String, Int): voldSolution
A sequence detector accepts as input a string of bits: either zero or one. Its output goes to one once a target sequence has been detected. There area unit 2 basic types: overlap and non-overlap. in an exceedingly sequence detector that enables overlap, the ultimate bits of 1 sequence may be the beginning of another sequence. Our example are a 11011 sequence detector. It raises AN output of one once the last five binary bits received area unit 11011. At this time, a detector with overlap can enable the last 2 one bits to serve at the primary of a next sequence. By example we tend to show the distinction between the 2 detectors. Suppose AN input string 11011011011.
 
 11011 detector with overlap X 11011011011
 Z 00001001001
 11011 detector with no overlap Z 00001000001
 
 The sequence detector with no overlap allowed resets itself to the beginning state once the sequence has been detected. Write the input sequence as 11011 011011. once the initial sequence 11011 has been detected, the detector with no overlap resets and starts finding out the initial one of following sequence. The detector with overlap allowed begins with the ultimate eleven of the previous sequence as able to be applied because the 1st eleven of following sequence; following bit it\'s yearning for is that the zero.
 
 Here is an outline of the planning procedure for a consecutive circuit.
 1) Derive the state diagram and state table for the circuit.
 2) Count the quantity of states within the state diagram (call it N) and calculate the
 variety of flip-flops required (call it P) by finding the equation
 2P-1 < N £ 2P. this can be best solved by guess the worth of P.
 3) Assign a singular P-bit binary variety (state vector) to every state.
 Often, the primary state = zero, following state = one, etc.
 4) Derive the state transition table and also the output table.
 5) Separate the state transition table into P tables, one for every flip-flop.
 WARNING: Things will get mussy here; neatness counts.
 6) elect the categories of flip-flops to use. once doubtful, use all JK’s.
 7) Derive the input table for every flip-flop mistreatment the excitation tables for the sort.
 8) Derive the input equations for every flip-flop based mostly as functions of the input
 and current state of all flip-flops.
 9) Summarize the equations by writing them in one place.
 10) Draw the circuit diagram. Most preparation assignments won\'t go this so much,
 because the circuit diagrams area unit exhausting to draw showing neatness.
Problem: style a 11011 sequence detector mistreatment JK flip-flops. enable overlap.
 
 Step one – Derive the State Diagram and State Table for the matter
 The method to be used for etymologizing the state diagram depends on the matter. I show the tactic for a sequence detector. At this time within the drawback, the states area unit sometimes tagged by a letter, with the initial state being tagged “A”, etc.
 
 Step 1a – verify the quantity of States
 It may be established that AN N-bit sequence detector needs a minimum of N states to perform properly. It also can be shown that a circuit with quite N states is unnecessarily sophisticated and a waste of hardware; therefore, AN N-bit sequence detector has N states.
 
 We area unit planning a sequence detector for a 5-bit sequence, therefore we want five states. we tend to label these states A, B, C, D, and E. State A is that the initial state.
 
 Step 1b – Characterize every State by What has been Input and what\'s Expected
 State Has Awaiting
 A -- 11011
 B one 1011
 C eleven 011
 D a hundred and ten eleven
 E one01 1
 
 Step 1c – Do the Transitions for the Expected Sequence
 Here may be a partial drawing of the state diagram. it\'s solely the sequence expected. Note that the diagram returns to state C once a prosperous detection; the ultimate eleven area unit used once more.


