1. Question:What should we do in the "Defining the Problem" phase of the programming process? 

    Answer
    1. Prepare the statement of the desired output (results to be produced by the program). the statement should be writing so that misunderstandings can be minimized. 
    2. A description of what the output is to look like.
    3. The input (data to be processed) must also be documented as a part of the problem definition.
    4. The solutions to some problems involve complex calculations. These must also be described in details as part of the problem definition.

    1. Report
  2. Question:Describe the following outline: 1. Process outline 2. Input/Output outline 3. Decision outline 

    Answer
    Figure: Process OutlineProcess Outline: Represents any manipulation of data, such as arithmetic operations or movement of data from one place to another or any initialization of data.Figure: Input/Output OutlineInput/Output Outline: Represents any data input or output operation.Figure: Decision OutlineDecision Outline: Represents the comparison of two values. Alternative courses of action can be taken according to whether the first value is greater than, less than, or equal to the second value.

    1. Report
  3. Question:How do you evaluate Boolean expressions without any parentheses? 

    Answer
    We have to evaluate as follows:
    
    1. All NOTs are evaluates first.
    2. All ANDs are evaluates next.
    3. Finally, all ORs are evaluated.

    1. Report
  4. Question:Prove that: A AND (B OR C) = (A AND B) OR (A AND C) 

    Answer
    ABCB OR CA AND (B OR C)A AND BA AND C(A AND B) OR (A AND C)
    FFFFFFFF
    FFTTFFFF
    FTFTFFFF
    FTTTFFFF
    TFFFFFFF
    TFTTTFTT
    TTFTTTFT
    TTTTTTTT

    1. Report
  5. Question:Prove that: NOT (A AND B) = NOT A OR NOT B 

    Answer
    ABA AND BNOT (A AND B)NOT ANOT BNOT A OR NOT B
    FFFTTTT
    FTFTTFT
    TFFTFTT
    TTTFFFF

    1. Report
  6. Question:Find largest number decision table. 

    Answer
    Find largest1 2 3 4
    A>=BYNYN
    A>=CY__N
    B>=C__YN
    A is largestX
    B is largestX
    C is largestXX

    1. Report
  7. Question:Define redundancy and contradiction in decision table. 

    Answer
    Redundancy: A situation in which more than one rule of a decision table may be applied for a given combination of conditions.Contradiction: A situation in a decision table in which the same combinations of conditions lead to different actions.

    1. Report
  8. Question:Define the following terms: 1. Control field 2. Control break 3. Control interval 4. Control area 5. False control break 

    Answer
    1. Control field: A field in input records that is used to sequence the file and that is checked to determine when a subtotal is to be printed.2. Control break: A change in the value in a control field between consecutive records in a field.3. Control interval: In a VSAM file, the unit of storage that is transferred on a read or write operation.4. Control area: In a VSAM file, a collection of control intervals.5. False control break: A control break - encountered when processing the first record in and ordered file - that does not actually reflect a change in the value in a control field.

    1. Report
  9. Question:Write a algorithm for counting positive, negative and zero number. 

    Answer
    1. Set positive,negative, and zero counters to 0
    2. Read a card; if there are no more numbers, go to step 6.
    3. If the number is positive, add one to the positive counter and go to step 2.
    4. If the number is negative, add one to the negative counter and go to step 2.
    5. Add one to the zero counter and go to step 2.
    6. Print counters.
    7. Stop.

    1. Report
  10. Question:Draw a flowchart for counting positive, negative and zero number. 

    Answer
    See your text book (Programming Practice and Techniques) at page 14, figure 1-9

    1. Report
Copyright © 2024. Powered by Intellect Software Ltd