Wednesday, September 26, 2012
A Simple Java program for a Car Park System (Psedocode)
PSEUDOCODE (Part 1)
Linked List Class
SETsize, inputNum1 to zero
INITIALIZE Instance Variables
INITIALIZE Variables
PRINT if any car numbers in garage
WHILE (True)
PRINT Enter garage
PRINT Exit garage
PRINT Display
PRINT Exit
READ input lines from User Input
CASE Enter garage:
IF (Car Size <9)
PRINT vacancies in garage
PRINT car number next to enter
READ input lines from the user
IF (Enter number is not the given number)
PRINT Sorry you have entered a wrong car number.Please enter correct car number
ELSE IF(Car size=0)
IF (Waiting list>0)
PRINT First car can enter garage
ELSE
PRINT No cars in waiting list
ELSE
PRINT Sorry!!!No Space. Wait at the Waiting List
WHILE (True)
PRINT would you like to add to waiting list
PRINT Yes
PRINT No
READ input lines from the user
CASE Yes:
READ input Car Number from the user
ADD to list2
RETURN main menu
CASE No:
RETURN main menu
CASE Exit From garage:
PRINT main garage
PRINT Waiting List
READ input lines from User Input
CASE main garage
IF(SIZE<O)
PRINT no cars
ELSE
PRINT State the car number
REMOVE
PRINT moves;
RETURN main menu
CASE Waiting list
IF(SIZE<O)
PRINT no cars in Waiting list
ELSE
PRINT State the car number
REMOVE
RETURN main menu
END CASE
CASE Display:
PRINT Main garage
PRINT Waiting List
READ input Car Number from the user
CASE Main garage:
PRINT car number
REMOVE
RERURN Main menu
CASE Waiting List
PRINT car number
REMOVE
RERURN Main menu
END CASE
CASE Exit: Exit from the application
END WHILE
END Main
Labels:
Computer Science
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment