1st Tutorial of Metode Perancangan Program

True / False

  1. Outline solutions : The step involves carefully reading and rereading the problem until you understand completely what is required
  2. The main purpose of desk checking the algorithm is to identify major logic errors early, so that they may be easily corrected
  3. Documentation only include external documentation such as hierarchy charts, the solution algorithm and test data result
  4. There are only two most common approaches to program design have emerged which are procedure – driven and event – driven
  5. An algorithm must be lucid, precise and unambiguous
  6. An algorithm must give the correct solution in all cases
  7. Boolean is one of the data structure types
  8. The correct type of data validation means the input data should match the data type definition stated at the beginning of the program
  9. There are five basic computer operations
  10. To give data an initial value in pseudocode is one of the example of a computer can assign a value to a variable or memory location
  11. ‘IF’ is used to show the repetition
  12. One of the basic control structures is sequence
  13. The linear nested IF statements can be changed into case structure
  14. The Do-While loop will test the logical condition first then execute the statement
  15. The first step of the Do loop is increment the loop_index by 1 for each pass through the loop

 

Display the output

  1.  Test_1

prompt operator for max_temp, min_temp

        get max_temp, min_temp

        avg_temp = (max_temp + min_temp)/2

        output avg_Temp to the screen

End

What will be the output if max_temp = 0, min_temp = 4

  1. Test_2

        a = 5, b = 6, c = 10, d=5

        if (a <> b) AND (b = d) OR (c>0) then

                        print “Hawaii Five O”

        else

                        if ( a = 5) then

                                        print “Blue Blood”

                        else

                                        print “CSI Miami”

                        endif

        endif

  1. Test_3

        set sum to zero

        do index = 1 to number_of_elements

                        sum = sum + array (index)

        enddo

        print sum

End

 

  1. Test_4

        set element to array(1)

        do index= 2 to 5

                        if array(index) > element Then

                                        element = array(index)

                        endif

        enddo

        print element

End

This entry was posted in Programming. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *