Flowchart and Algorithm Basics: The Art of Programming by A. B. Chaudhuri

Flowchart and Algorithm Basics: The Art of Programming by A. B. Chaudhuri

Author:A. B. Chaudhuri [Chaudhuri, A. B.]
Language: eng
Format: epub, mobi
Publisher: Mercury Learning and Information
Published: 2020-08-15T04:00:00+00:00


The algorithm showing the solution for Problem 3.28 is shown below:

Step 1.REPEAT STEPS 2 THROUGH 5 UNTIL USER SIGNALS ‘EXIT’

Step 2.INPUT TO W

(Accept the weight of the luggage and store it in W)

Step 3.IF W <= 0

 THEN EXIT

END-IF

Step 4.IF W <= 40

 THEN CHG ← 5.75

ELSE IF W <= 500

  THEN COMPUTE EW ← W – 40

  COMPUTE INV ← Integer part of

  COMPUTE CHG ← 5.75 + INV*3.88

 ELSE

 COMPUTE CHG ← 5.75 + 26*3.88 + (W – 500)*0.67

 END-IF

END-IF

Step 5.PRINT “THE CHARGE IS $”, CHG

Step 6.STOP



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.