Horje
pseudocode Code Example
pseudocode
Integer i, j, k
Set k = 8for(each i from 1 to 1)
        for(each j from the value of i to 1)
            print k+1
        end for
end for
pseudocode
from sre_constants import REPEAT

import START as START

START
REPEAT


class Total:
    pass


Total +0


class TotalPeople:
    pass


TotalPeople 0


class DayNo1:
    pass


DayNo1 0


class DayNo2:
    pass


DayNo2 + 0
ExtraAttract 0
Upto +0
OneDayBookings +0
TwoDayBookings e 0
TicketNum
ExtraError E 0
Booking number + Booking number + 1
PRINT "Do you wanna book a One day ticket or a Two day ticket"
INPUT TicketNum
ExtraError E 0
Booking number + Booking number + 1
PRINT "Do you wanna book a One day ticket or a Two day ticket"
INPUT TicketNum
WHILE TicketNum <> 2 OR TicketNum <> 1 DO
     PRINT "Please choose either a 1 day or a 2 day ticket"
     INPUT TicketNum
ENDWHIL
PRINT "What's the total amount of adults being booked?"
INPUT adult
Upto e adult*2
PRINT "What's the total amount of senior's being booked?"
INPUT senior
PRINT "What ticket would you like?"
PRINT "TYPE 'F' TO STOP"
INPUT OneDayBookings
CASE OneDayBookings OF:
A. Total E Total + 20
B. IF upto>= children
THEN
     Total € Total + 12
ELSE
     ErrorNo1 e ErrorNo1 + 1
     PRINT" The limit has been crossed please bring two children and
try again."
C. Total e Total + 16
D. IF (upto >= children OR seniors >= 1) AND children >= 3
THEN
      Total + Total + 60
ELSE
     ErrorNo1 E ErrorNo1 + 1
     PRINT "The limit has been crossed please bring two adults or
seniors and three children at max and try again."
E. IF TotalPeople < 6
THEN
     ErrorNo1 + ErrorNo1 + 1
     PRINT "This ticket requires six people at minimum, please try
again"
ELSE
           Total + Total + TotalPeople*15
ENDCASE
UNTIL OneDayBookings = 6 OR ErrorNo1 0
ENDREPEAT
ELSEIF TicketNum 2 THEN
ENDCASE
UNTIL OneDayBookings = 6 OR ErrorNo1 0
ENDREPEAT
ELSEIF TicketNum 2 THEN
REPEAT
      PRINT "What ticket would you like?"
      PRINT "TYPE 'F' TO STOP"
      INPUT TwoDayBookings
CASE TwoDayBookings OF:
A. Total e Total + 30
B. IF upto>= children
      THEN
             Total + Total + 18
      ELSE
             ErroNo2 € ErrorNo2 + 1
             PRINT" The limit has been crossed please bring two children and
      try again."
C. Total + Total + 24
D. IF (upto >= children OR seniors >= 1) AND children >=3
      THEN
             Total e Total + 90
      ELSE
             ErrorNo2 E ErrorNo2 + 1
             PRINT "The limit has been crossed please try buying this by
      registering inside the limit (2 adults/seniors and 3 children at max)
                                                                  "
E. IF TotalPeople < 6
      THEN
             ErrorNo2 E ErrorNo2 + 1
             PRINT "This ticket requires six people minimum. Please try again"
      ELSE
Total + TotalPeople + Total * 22.5
ENDCASE
UNTIL TwoDayBookings = 6 OR ErrorNo2 = 0
ENDREPEAT
ENDIF
PRINT "Available extra attractions:
   1. Lion feeding: $2.50
   2. Penguin feeding: $2
   3. Evening Barbecue (2 days ticket only): $5"
REPEAT
      PRINT "What extra attraction would you like to buy? (TYPE END TO MOVE FORWARD)
      INPUT ExtraAttract
     IF ExtraAttract = 1
      THEN
            Total e Total + 2.5
     ELSEIF ExtraAttract = 2
      THEN
            Total + Total + 2
      ELSEIF TicketNum = 2 AND ExtraAttract = 3
      THEN
            Total e Total + 5
      ELSE
Extratrror E1
PRINT "To add this attraction you are required to carry a 2 day ticket"
ENDIF
UNTIL ExtraAttract =0 AND ExtraError 0
ENDREPEAT
PRINT "What day would you like to choose for your booking? (If it is a 2 day ticket the day next
to the chosen day will be considered day 2)"
PRINT bookingday (0:6)
INPUT DayNo1
FOR Count 0 TO BookingDay.length
IF count = DayNo1
THEN
BookingDay.remove
FirstDayCount count
ENDIF
NEXT
IF TicketNum- 2
THEN
SecondDayCount FirstDayCount +1
IF SecondDayCount = 7
THEN
    SecondDayCount +0
ENDIF
DayNo2 E BookingDay(SecondDayCount)
ENDIF
IF TicketNum - 1
THEN
PRINT"A total number of people ", TotalPeople, "are going to the park on,"DayNo1"
"You have bought the ", TicketNum, "Tickets totaling to a cost of: $",Total, "Your boking
number", Booking number
ELSEIF TicketNum = 2
THEN
PRINT"A total number of people ", TotalPeople, "are going to the park on,"DayNo1,
"and", DayNo2". "You have bought the ", TicketNum, "Tickets totaling to a cost of: $",Total,
"Your boking number", Booking number
ENDIF
PRINT "Are you sure you want to proceed to the checkout?"
INPUT CheckBackorProceed
UNTIL CheckBackorProceed= Proceed
ENDREPEAT
pseudocode
[0]
Pseudocode is an artificial and informal language that helps programmers develop algorithms. Pseudocode is a "text-based" detail (algorithmic) design tool. The rules of Pseudocode are reasonably straightforward. All statements showing "dependency" are to be indented. These include while, do, for, if, switch.
[1]
n computer science, pseudocode is a plain language description of the steps in an algorithm or another system. Pseudocode often uses structural conventions of a normal programming language, but is intended for human reading rather than machine reading. It typically omits details that are essential for machine understanding of the algorithm, such as variable declarations and language-specific code. The programming language is augmented with natural language description details, where convenient, or with compact mathematical notation. The purpose of using pseudocode is that it is easier for people to understand than conventional programming language code, and that it is an efficient and environment-independent description of the key principles of an algorithm. It is commonly used in textbooks and scientific publications to document algorithms and in planning of software and other algorithms.
[2]
Pseudo code is a term which is often used in programming and algorithm based fields. It is a methodology that allows the programmer to represent the implementation of an algorithm. Simply, we can say that it’s the cooked up representation of an algorithm. Often at times, algorithms are represented with the help of pseudo codes as they can be interpreted by programmers no matter what their programming background or knowledge is. Pseudo code, as the name suggests, is a false code or a representation of code which can be understood by even a layman with some school level programming knowledge.

Algorithm: It’s an organized logical sequence of the actions or the approach towards a particular problem. A programmer implements an algorithm to solve a problem. Algorithms are expressed using natural verbal but somewhat technical annotations.

Pseudo code: It’s simply an implementation of an algorithm in the form of annotations and informative text written in plain English. It has no syntax like any of the programming language and thus can’t be compiled or interpreted by the computer.

#example of pseudocode

1.. If student's grade is greater than or equal to 60

Print "passed"
else
Print "failed"
pseudocode
from sre_constants import REPEAT

import START as START

START
REPEAT


class Total:
    pass


Total +0


class TotalPeople:
    pass


TotalPeople 0


class DayNo1:
    pass


DayNo1 0


class DayNo2:
    pass


DayNo2 + 0
ExtraAttract 0
Upto +0
OneDayBookings +0
TwoDayBookings e 0
TicketNum
ExtraError E 0
Booking number + Booking number + 1
PRINT "Do you wanna book a One day ticket or a Two day ticket"
INPUT TicketNum
ExtraError E 0
Booking number + Booking number + 1
PRINT "Do you wanna book a One day ticket or a Two day ticket"
INPUT TicketNum
WHILE TicketNum <> 2 OR TicketNum <> 1 DO
     PRINT "Please choose either a 1 day or a 2 day ticket"
     INPUT TicketNum
ENDWHIL
PRINT "What's the total amount of adults being booked?"
INPUT adult
Upto e adult*2
PRINT "What's the total amount of senior's being booked?"
INPUT senior
PRINT "What ticket would you like?"
PRINT "TYPE 'F' TO STOP"
INPUT OneDayBookings
CASE OneDayBookings OF:
A. Total E Total + 20
B. IF upto>= children
THEN
     Total € Total + 12
ELSE
     ErrorNo1 e ErrorNo1 + 1
     PRINT" The limit has been crossed please bring two children and
try again."
C. Total e Total + 16
D. IF (upto >= children OR seniors >= 1) AND children >= 3
THEN
      Total + Total + 60
ELSE
     ErrorNo1 E ErrorNo1 + 1
     PRINT "The limit has been crossed please bring two adults or
seniors and three children at max and try again."
E. IF TotalPeople < 6
THEN
     ErrorNo1 + ErrorNo1 + 1
     PRINT "This ticket requires six people at minimum, please try
again"
ELSE
           Total + Total + TotalPeople*15
ENDCASE
UNTIL OneDayBookings = 6 OR ErrorNo1 0
ENDREPEAT
ELSEIF TicketNum 2 THEN
ENDCASE
UNTIL OneDayBookings = 6 OR ErrorNo1 0
ENDREPEAT
ELSEIF TicketNum 2 THEN
REPEAT
      PRINT "What ticket would you like?"
      PRINT "TYPE 'F' TO STOP"
      INPUT TwoDayBookings
CASE TwoDayBookings OF:
A. Total e Total + 30
B. IF upto>= children
      THEN
             Total + Total + 18
      ELSE
             ErroNo2 € ErrorNo2 + 1
             PRINT" The limit has been crossed please bring two children and
      try again."
C. Total + Total + 24
D. IF (upto >= children OR seniors >= 1) AND children >=3
      THEN
             Total e Total + 90
      ELSE
             ErrorNo2 E ErrorNo2 + 1
             PRINT "The limit has been crossed please try buying this by
      registering inside the limit (2 adults/seniors and 3 children at max)
                                                                  "
E. IF TotalPeople < 6
      THEN
             ErrorNo2 E ErrorNo2 + 1
             PRINT "This ticket requires six people minimum. Please try again"
      ELSE
Total + TotalPeople + Total * 22.5
ENDCASE
UNTIL TwoDayBookings = 6 OR ErrorNo2 = 0
ENDREPEAT
ENDIF
PRINT "Available extra attractions:
   1. Lion feeding: $2.50
   2. Penguin feeding: $2
   3. Evening Barbecue (2 days ticket only): $5"
REPEAT
      PRINT "What extra attraction would you like to buy? (TYPE END TO MOVE FORWARD)
      INPUT ExtraAttract
     IF ExtraAttract = 1
      THEN
            Total e Total + 2.5
     ELSEIF ExtraAttract = 2
      THEN
            Total + Total + 2
      ELSEIF TicketNum = 2 AND ExtraAttract = 3
      THEN
            Total e Total + 5
      ELSE
Extratrror E1
PRINT "To add this attraction you are required to carry a 2 day ticket"
ENDIF
UNTIL ExtraAttract =0 AND ExtraError 0
ENDREPEAT
PRINT "What day would you like to choose for your booking? (If it is a 2 day ticket the day next
to the chosen day will be considered day 2)"
PRINT bookingday (0:6)
INPUT DayNo1
FOR Count 0 TO BookingDay.length
IF count = DayNo1
THEN
BookingDay.remove
FirstDayCount count
ENDIF
NEXT
IF TicketNum- 2
THEN
SecondDayCount FirstDayCount +1
IF SecondDayCount = 7
THEN
    SecondDayCount +0
ENDIF
DayNo2 E BookingDay(SecondDayCount)
ENDIF
IF TicketNum - 1
THEN
PRINT"A total number of people ", TotalPeople, "are going to the park on,"DayNo1"
"You have bought the ", TicketNum, "Tickets totaling to a cost of: $",Total, "Your boking
number", Booking number
ELSEIF TicketNum = 2
THEN
PRINT"A total number of people ", TotalPeople, "are going to the park on,"DayNo1,
"and", DayNo2". "You have bought the ", TicketNum, "Tickets totaling to a cost of: $",Total,
"Your boking number", Booking number
ENDIF
PRINT "Are you sure you want to proceed to the checkout?"
INPUT CheckBackorProceed
UNTIL CheckBackorProceed= Proceed
ENDREPEAT




Whatever

Related
geometric model Code Example geometric model Code Example
blurb meaning Code Example blurb meaning Code Example
app:mergeDexDebug Code Example app:mergeDexDebug Code Example
https://discord.gg/pNkFmuf4 Code Example https://discord.gg/pNkFmuf4 Code Example
what caused the battle of dieppe to happen Code Example what caused the battle of dieppe to happen Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7