Advertisement
HarisZamil

Pseudocode Code G4

Jul 5th, 2020
3,552
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.54 KB | None | 0 0
  1. Pseudocode Code
  2.  
  3. 1START
  4. 2Display "Welcome to The Hospital"
  5. 3Display "Please enter your name, IC, Date and phone_number"
  6. 4Input Please enter your name, IC, Date and phone_number
  7. 5Display”What type of service do you want to get?
  8. 6Display “Enter 1 for consultation, 2 for other types of services 3 for surgery”
  9. 7Input i
  10.  
  11. 8If I=1
  12. 9Display “You have chosen consultation service”
  13. 10. Display “Please wait for your name to be called in front of room 1 to 5
  14. 11. Display “What is your problem? 1Flu 2Wound 3Cough”
  15. 12. Input D
  16.  
  17. 13. If D=1
  18. 14. Display “What is your temperature?
  19. 15. Input c
  20. 16. If c>=29.0
  21. 17. Display “You need to be checked and warded”
  22. 18. Else
  23. 19. Display “You have a normal fever”
  24. 20. Goto payment
  25.  
  26. 21. Else if D=2
  27. 22. Display “The wound need to be disinfect and bandaged
  28. 23. Got payment
  29.  
  30. 24. Else if D=3
  31. 25. Display “Does your tonsil have inflammation?
  32. 26. Input Y/N
  33. 27. If Y (goto line 14)
  34. 28. Else
  35. 29. Display “You have normal 5 cough”
  36.  
  37. 30. else
  38. 31. goto line 11
  39.  
  40. 32. if i=2
  41. 33. Display “You have chosen other services”
  42. 34. Display “Please wait for your name to be called in front of room 6 to 8”.
  43. 35. Display”What is your health issue?”.
  44. 36. Display”Is it a serious problem?(Y /N)
  45. 37. Input d
  46.  
  47. 38. If d=4
  48. 39. Display”You will be checked thoroughly”
  49. 40. Else
  50. 41. Display“You will be checked normally”
  51. 42. Goto payment
  52.  
  53. 43. If i=3
  54. 44. Display “You have chosen other services”
  55. 45. Display “Please wait for your name to be called in front of room 6 to 8
  56. 46. Display”Do you have an appointment?
  57. 47. Input Y/N
  58. 48. If y
  59. 49. Display”Set and appointment with the doctor for another day”
  60. 50. Goto line 35
  61. 51. Else
  62. 52. Display”What type of surgery do you need?
  63. 53. Display6 for optometrist 7 for audiologist 8 for neurology”
  64. 54. Input D
  65.  
  66. 55. If D=6
  67. 56. Display” Please go to the optometrist department”
  68. 57. Goto payment
  69.  
  70. 58. Else if D=7
  71. 59. Display” Please go to the audiologist department”
  72. 60. Goto payment
  73.  
  74. 61. Else if D=8
  75. 62. Display” Please go to the neurology department”
  76. 63. Goto payment
  77. 64. .
  78. 65. .
  79. 66. D=P
  80. 67. If P=1
  81. 68. Display”Your service charge is RM10"
  82. 69. Else if P=2
  83. 70. Display”Your service charge is RM10"
  84. 71. Else if P=3
  85. 72. Display”Your service charge is RM10"
  86. 73. Else if P=4
  87. 74. Display”Your service charge is RM5
  88. 75. Else if P=5
  89. 76. Display”Your service charge is RM5"
  90. 77. Else if P=6
  91. 78. Display”Your service charge isRM800”
  92. 79. Else if P=7
  93. 80. Display”Your service charge is RM10"
  94. 81. Else
  95. 82. Display”Your service charge is RM1500”
  96. 83. Display”Your total payment will be”
  97. 84. Display payment,P
  98. 85. Display” Do you want to pay with cash or card?”
  99. 86. 1 for Cash 2 for Card 3 for e- wallet
  100. 87. Input C
  101.  
  102. 88. If C=1
  103. 89. Display”Please pay according the receipt shown using cash”
  104. 90. Input M
  105. 91. Balance,B= M – P
  106. 92. Display”Your balance will be”
  107. 93. Display Balance,B
  108. 94. Display type_of_service,tax,payment
  109. 95. Display”Thank You’
  110.  
  111. 96. If C=2
  112. 97. Display”Please enter your card information” 98. Is the card valid?
  113. 99. If Y
  114. 100.    Display type_of_service,tax,payment
  115. 101.    Display”Thank You’
  116. 102.    Else
  117. 103.    Display”Your card is not valid, do you want to try again?(Y/N)”
  118. 104.    If Y (goto line 97)
  119. 105.    Else (goto line 89)
  120.  
  121. 106.    If C=3
  122. 107.    Display”Please Enter Wallet name”
  123. 108.    Input wallet_name
  124. 109.    Display“Thank you your Payment has been received”
  125. 110.    Display”Thank You
  126. 111.    END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement