Algorithm 1. start. 2. configure the payment amount (Price) is equal to zero. 3. stock information (Amt) and the price (Cost). 4. calculate the amount paid from the Amt Cost Price = x. 5. display. The amount that must be paid. 6. exit. Pseudocode (Pseudo Code). Begin Price = 0 Read Amt, Cost Price = Amt x Cost Write Price End Structure of the selection (Selection Structure). The conditions that must be decided is the work results of the condition is true or false only. The type of the selected structure 1. Select the run only when a condition is true. Pseudocode IF............... THEN (A command) ... For example, the program displays the result on the screen. Algorithm 1. start. 2. pick up test scores (Score) 3. If the exam score 50 points or more, print screen ' You pass '. 4. exit. Pseudocode (Pseudo Code). Begin Read Score IF Score >= 50 THEN Write 'You pass' End 2. Select one of the real and the false condition during. Pseudocode (Instruction B) ..... THEN ..... ELSE (commands A) ..... ... 3. Select the nested command. Algorithm 1. start. 2. pick up test scores (Score) 3. compare the test scores > = 80 If true, do A ' Grade = ' expression. If false, compare test scores > = 70, if true, make the Grade B = ' expression '. If false, compare test scores > = 60, if true, make the Grade = ' C ' expression. If false, compare test scores > = 50, if true, make the Grade D = ' expression '. If the expression is false, to make Grade = ' F ' 4. the display of grades (Grade) 5. exit.
การแปล กรุณารอสักครู่..
