ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 1 of 4 ITECH5403 - Assignment 2 – Parallel Implementations Due...

1 answer below »
I want this assignment done


ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 1 of 4 ITECH5403 - Assignment 2 – Parallel Implementations Due Date: 4pm, Friday of Week 11 This assignment will test your skills in programming applications to specification in a number of different programming languages, and is worth 20% of your non-invigilated (type A) marks for this course. Assignment Overview You are tasked with creating a program for a pizza shop – however, as this is a comparative languages course, you will be creating the same application in the following programming languages:  C,  Python,  Java and  Lisp. As you implement the application in each language, you should keep notes on the features of the languages used, which you found useful, as well as any issues or complications which arose due to the complexity or lack of any language features. A brief discussion based on these programming features for each individual language accompanying each implementation is required. Finally, a comparative overview of the languages highlighting applicability based on your experience in the design, implementation and debugging of your code is also required. If you foresee or encounter any complications, you may opt to implement or incorporate additional language features which may be lacking, i.e. data structures. This can be done via:  Your own implementation,  Through libraries, or  Via the incorporation of existing source code. You can use code found on the Internet, but use of any existing code must be referenced. Program Specification Users may order one or more pizzas, where each pizza may be either: small, medium or large. Small pizzas cost $5, medium pizzas cost $8 and large pizzas cost $12. All pizzas come on a tomato base (for our pizza shop, this will be the only option), and will have the topping cheese by default, at no extra cost. Users may choose up to a maximum of four additional toppings (bringing the total to five) from the following list, where each topping adds an additional $1 to the price of the pizza:  Bacon,  Olives,  Ham,  Mushrooms, ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 2 of 4  Pineapple,  Salami,  Anchovies. A pizza order consists of an order for one or more pizzas, where each pizza has a size, and may optionally include a list of up to four additional toppings. Each pizza order must be marked as either to be collected or to be delivered. If the pizza is to be collected then the order requires a name and a phone number to be valid. If the pizza is to be delivered then a name, phone number and address are required to be valid. In addition, if the order total is less than $30 then an $8 delivery fee is added to the total. The application must be error tolerant and capable of accepting keyboard input to store a number of pizza orders in memory (they do not have to be persisted to file), as well as displaying an order summary which include details of all orders, including:  The details of each pizza in the order,  The total cost of the order, and  The name, phone number and (if required) address of the person who made the order. Suggested Development Environments Codeblocks for C '99 Code::Blocks can be downloaded from: http://www.codeblocks.org/downloads/binaries To create a new C project is: When you create a project, choose File | New and then Console Application, and then choose C as the programming language. IDLE for Python Python, including the IDLE development environment can be downloaded from: https://www.python.org/downloads/ Eclipse for Java 7 or Java 8 Eclipse may be freely downloaded from: http://www.eclipse.org/downloads/ Eclipse does not come with the Java JDK, which must the downloaded separately from: http://www.oracle.com/technetwork/java/javase/downloads/index.html Ensure that your Eclipse type and Java type match – i .e. 32-bit Java for 32-bit Eclipse, or 64-bit Java for 64-bit Eclipse. If you mix and match it won't work. GNU CLisp for Common Lisp CLISP 2.49 can be sourced from: http://sourceforge.net/projects/clisp/files/latest/download Any good text editor would be suitable for writing the source code. http://www.codeblocks.org/downloads/binaries https://www.python.org/downloads/ http://www.eclipse.org/downloads/ http://www.oracle.com/technetwork/java/javase/downloads/index.html https://outlook.uob.ballarat.edu.au/owa/redir.aspx?C=9MoDa4qCzkGxEQcHXoGO-In6cvxuS9IIOylNrUMOg4Vfq4CuCsnO-y-CR81ZnSWrssnu0V7Y3uM.&URL=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fclisp%2Ffiles%2Flatest%2Fdownload ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 3 of 4 Additional Documentation – Language Suitability Report The design of each programming language incorporates a number of decisions about the language which make it more or less suitable for given tasks. During your implementation of the pizza program in each of the languages you should make notes about the language features which exist or do not exist, and which have therefore made program development easier or more difficult. Where a language has not provided a feature which would have been useful to the implementation of the program, or where the complexity of using a language feature has been high you should remark upon it and briefly discuss a mechanism or feature of another language which would have made development easier. After completing the application in all languages (or as many as you can), discuss the comparative ease of implementation in terms of the design, implementation and debugging for each programming language, including how robustness issues were addressed. Submission and Marking Process You must supply your program source code fi les and language suitability report documentation in as single compressed archive called: ITECH5403_Assignment_2__.zip You may supply your programming language suitability report in either Word or LibreOffice/OpenOffice format in which the document can be edited – no proprietary Mac specific formats , please. Assignments will be marked on the basis of fulfi lment of the requirements and the quality of the work. In addition to the marking criteria, marks may be deducted for failure to comply with the assignment requirements, including (but not l imited to):  Incomplete implementation(s), and  Incomplete submissions (e.g. missing fi les), and  Poor spelling and grammar. Submit your assignment (all program source fi les plus your discussion document) to the Assignment 2 Upload location on Moodle before the deadline of Friday of Week 11 at 4pm. The mark distribution for this assignment is explained on the next page. ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 4 of 4 Assignment 2 – Parallel Implementations Student name: Student ID: Requirement Weight Mark Implementation of the pizza shop program in the C programming language. Areas of note include: - Use of data structures, - Robust input handling which does not cause program termination if provided with bad data (i.e. program expects a number, gets given alphanumerical data). Discussion on implementation: - Language features, issues and suitability. 15 5 Implementation of the pizza shop program in the Python programming language. Areas of note include: - Python Standard library, - List mechanisms, Discussion on implementation: - Language features, issues and suitability 15 5 Implementation of the pizza shop program in the Java programming language. Areas of note include: - Object orientation mechanism / method calls, - Error handling - Standard Java libraries Discussion on implementation - Language features, issues and suitability 15 5 Implementation of the pizza shop program in the Lisp programming language. Areas of note include the Lisp: - Use of recursion - lists - Inbuilt data structures Discussion on implementation - Language features, issues and suitability 15 5 Documentation and discussion of the comparative ease of implementation (design / implement / debug) in each programming language, including how robustness issues were addressed. 15 Spelling and grammar 5 Assignment mark total / 100 Contribution to unit mark (out of 20%) % Comments:
Answered Same DaySep 20, 2021ITECH5403

Answer To: ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information...

Yogesh answered on Sep 26 2021
158 Votes
Lisp Code/pizzaorders.txt
Name: Yogesh.@Phone Number: 8075462515.@Address: N.A..@@1.) Pizza size: Small, Price: $5, Number of Pizzas: 4, @ Toppings: Bacon, Mushrooms, Anchovies, Pineapple.@@2.) Pizza size: Medium, Price: $8, Number of Pizzas: 1, @ Toppings: Mushrooms, Anchovies, Bacon, Pineapple.@1$ charged for Each Topping on each pizza.@@Order Type: Collect. @@Total Amount: $48.
Name: Yogi.@Phone Number: 8888888888.@Address: austrelia.@@1.) Pizza size: Large, Price: $12, Number of Pizzas: 1, @ Toppings: Bacon, Mushrooms, Anchovies, Pineapple.@1$ charged for Each Topping on each pizza.@@Order Type: Deliver.@(Additional $8 Delivery Charge for Total Amount below $30.)@@Total Amount: $24.
Name: Yogisan.@Phone Number: 8787878798.@Address: N.A..@@1.) Pizza size: Small, Price: $5, Number of Pizzas: 4, @ Toppings: Bacon, Mushrooms, Anchovies, Pineapple.@@2.) Pizza size: Medium, Price: $8, Number of Pizzas: 1, @ Toppings: Bacon, Mushrooms, No Topping, Anchovies.@1$ charged for Each Topping on each pizza.@@Order Type: Collect. @@Total Amount: $47.
Lisp Code/PizzaShop.lisp
(setq *print-case* :capitalize)
;file for storing data
(setq *creds* "pizzaorders.txt")
; temp list storing data before storing to text file
(defparameter *file* (make-array 5 :initial-element 'fl))             ;[fl, fl, fl, fl, fl]
; list of pizza sizes
(defparameter *sizes* (make-array 4 :initial-element 'None)) ;["None", "Small", "Medium", "Large"]
(setf (aref *sizes* 0) "None")    
(setf (aref *sizes* 1) "Small")    
(setf (aref *sizes* 2) "Medium")    
(setf (aref *sizes* 3) "Large")
    
; list of pizza prices according to size
(defparameter *price* (make-array 4 :initial-element 0)) ; [0, 5, 8, 12]
(setf (aref *price* 0) 0)    
(setf (aref *price* 1) 5)    
(setf (aref *price* 2) 8)    
(setf (aref *price* 3) 12)    
; list of pizza toppings
(defparameter *toppings* (make-array 8 :initial-element 'NoT
opping)) ; ["No Topping", "Bacon", "Olives", "Ham", "Mushrooms", "Pineapple", "Salami", "Anchovies"]
(setf (aref *toppings* 0) "No Topping")    
(setf (aref *toppings* 1) "Bacon")    
(setf (aref *toppings* 2) "Olives")    
(setf (aref *toppings* 3) "Ham")    
(setf (aref *toppings* 4) "Mushrooms")    
(setf (aref *toppings* 5) "Pineapple")    
(setf (aref *toppings* 6) "Salami")    
(setf (aref *toppings* 7) "Anchovies")    
; list of order type
(defparameter *ortype* (make-array 3 :initial-element '"None")) ; ["None", "Collect", "Deliver"]
(setf (aref *ortype* 0) "None")    
(setf (aref *ortype* 1) "Collect")    
(setf (aref *ortype* 2) "Deliver")    
; order list flags.
(defparameter *order* (make-array '(10 8) :initial-element 0))
(defun start0()
    (format t "~%~%-------------------------------------------------------------------------")
    (format t "~%--------------------- Welcome to Pizza Shop ---------------------")
    (format t "~%-------------------------------------------------------------------------")
    (format t "~%Main Menu - ")
    (format t "~% Option 1.) Add Order.")
    (format t "~% Option 2.) View Orders.")
    (format t "~% Option 3.) Exit.")
    (start1)
)
(defun start1()
    (format t "~%Please Enter an Option: ")
    (setq ip0a (read))
    (if (equalp ip0a 1)
        (start3)
    (if (equalp ip0a 2)
        (views)
    (if (equalp ip0a 3)
        (exitp)
        (excep0)
    )))
)
(defun excep0()
    (format t "~%~%Please Enter the Correct Option.")
    (start1)
)
(defun exitp()
    (format t "~%~%Do you really want to QUIT ?")
    (format t "~%[Y]es / [N]o : ")
    (setq aq5 (read))
    (setq y 'y)
    (setq n 'n)
    (if (equalp aq5 y)
        (endprog)
    (if (equalp aq5 n)
        (gotostart)
    (if (equalp aq5 " ")
        (gotostart)
        (excep1)
    )))
)
(defun endprog()
    (format t "~%~% Thanks for using Pizza Shop Application...!~%~%")
    (quit)
)
(defun gotostart()
    (format t " ")
    (start0)
)
(defun excep1()
    (format t "~%Please Enter Correct Option...")
    (exitp)
)
(defun start2()
    (format t "~%~%Add a new Order...")
    (start3)
)
(defun start3()
    (format t "~%~%Please Select an Option for Pizza Size from below: ")
    (format t "~% Option 1.) Small Pizza - $5 ")
    (format t "~% Option 2.) Medium Pizza - $8 ")
    (format t "~% Option 3.) Large Pizza - $12 ")
    (sizeselect)
)
(defun sizeselect()
    (defparameter *psize* 0)
    (format t "~%Please Enter an Option for Pizza Size : ")
    (setq *inp1a* (read))
    (if (or (equalp *inp1a* 1)(equalp *inp1a* 2)(equalp *inp1a* 3))
        (size2)
        (excep2)
    )
)
(defun size2()
    (setq *psize* *inp1a*)
    (sizesave)
)
(defun excep2()
    (format t "~%~%Please Enter the Correct Option for Pizza size.")
    (sizeselect)
)
(defun sizesave()
    (defparameter *i* 0)
    (loop for j from 0 to 9
     do (setq s (aref *order* j 0))
        (if (not(equalp s 0))
            (setq *i* (+ *i* 1))
        )
    )
    (setf (aref *order* *i* 0) *psize*)
    (format t "~%All pizzas come on a 'Tomato base'(for our Pizza Shop this is the only option),
and have the topping 'Cheese' by default, at no Extra cost.
You may Choose up to a Maximum of '4' additional toppings from the following list :-
(Each topping adds an additional $1 to the price of the pizza.)")
    (format t "~%~%Please Select an Option for Toppings from below: ")
    (format t "~% Option 0.) No Topping")
    (format t "~% Option 1.) Bacon")
    (format t "~% Option 2.) Olives")
    (format t "~% Option 3.) Hum")
    (format t "~% Option 4.) Mushrooms")
    (format t "~% Option 5.) Pineapple")
    (format t "~% Option 6.) Salami")
    (format t "~% Option 7.) Anchovies")
    (toppingselect)
)
(defun toppingselect()
    (format t "~%Please Enter an Option between '0' and '7' : ")
    (format t "~%Please Enter First topping : ")
    (setq *topping1* (read))
    (format t "~%Please Enter Second topping : ")
    (setq *topping2* (read))
    (format t "~%Please Enter Third topping : ")
    (setq *topping3* (read))
    (format t "~%Please Enter Fourth topping : ")
    (setq *topping4* (read))
    
    (if (and (and (>= *topping1* 0) (<= *topping1* 7)) (and (>= *topping2* 0) (<= *topping2* 7))
            (and (>= *topping3* 0) (<= *topping3* 7)) (and (>= *topping4* 0) (<= *topping4* 7)))
            (setvalues)
            (excep3))
)
(defun setvalues()
    (setf (aref *order*    *i* 1) *topping1*)
    (setf (aref *order*    *i* 2) *topping2*)
    (setf (aref *order*    *i* 3) *topping3*)
    (setf (aref *order*    *i* 4) *topping4*)
    (showpizza)
)
(defun excep3()
    (format t "~%~%Please Enter Correct Toppings Options...")
    (toppingselect)
)
(defun showpizza()
    (format t "~%~%Your Customized Pizzas are: ")
    (loop for j from 0 to 9
     do (setq s (aref *order* j 0))
        (if (not(equalp s 0))
            (format t "~% Pizza Size: ~a, Toppings: ~a, ~a, ~a, ~a." (aref *sizes* (aref *order* j 0)) (aref *toppings* (aref *order* j 1))
            (aref *toppings* (aref *order* j 2)) (aref *toppings* (aref *order* j 3)) (aref *toppings* (aref *order* j 4))))
        (if (not (equalp (aref *order* j 5) 0))
            (format t "~% Quantity: ~d.~%" (aref *order* j 5)))
    )
    (pizzacount)
)
    
(defun pizzacount()
    (format t "~%~%Please Enter number of Pizzas: ")
    (setq pizzano (read))
    (setf (aref *order* *i* 5) pizzano)
    (check0)
)
(defun check0()
    (format t "~%~%Would you like to Add another pizza in your Order ? ([Y]es/[N]o)")
    (setq ans (read))
    (setq y 'y)
    (setq n 'n)
    (if (equalp ans y)
        (start3)
    (if (equalp ans n)
        (ordertype)
    (if (equalp ans " ")
        (excep4)
        (excep4))))
)
(defun excep4()
    (format t "~%~%Please Enter Valid Option...")
    (check0)
)
(defun ordertype()
    (format t "~%Will you [C]ollect your Order from Shop or want to get [D]elivered to you ?")
    (setq ans (read))
    (setq c 'c)
    (setq d 'd)
    
    (loop for j from 0 to 9
     do (setq s (aref *order* j 0 ))
        (if (not (equalp s 0))
            (if (equalp ans c)
                (setf (aref *order* j 6) 1)
            (if (equalp ans d)
                (setf (aref *order* j 6) 2)
            (if (equalp ans " ")
                (excep5)
                (excep5))))
        )
    )
    (enterdetails)
)
(defun excep5()
    (format t "~%~%Please Enter Valid Option.")
    (ordertype)
)
(defun enterdetails()
    (format t "~%Please enter your Name: ")
    (setq *name* (read-line))
    (format t "~%Please enter your Phone Number: ")
    (setq *phone* (read-line))
    (setq *address* '"N.A.")
    (if (equalp (aref *order* 0 6) 2)
        (add)
    )
    (showorder)
)
(defun add()
    (format t "~%Please enter delivery Address: ")
    (setq *address* (read-line))
)
(defun showorder()
    (setq namec (string-capitalize *name*))
    (format t "~%~%--------------------- Order Invoice ---------------------")
    (setq *invoicep1* (format nil "~%Name: ~a.~%Phone Number: ~a.~%Address: ~a." namec *phone* *address*))
    (setq *save1* (format nil "Name: ~a.@Phone Number: ~a.@Address: ~a." namec *phone* *address*))
    (format t *invoicep1*)
    (setq *totalprice* 0)
    (setq *k* 1)
    (defparameter *invoicep2* (make-array 10 :initial-element 'a)) ;[a, a, a, a, a, a, a, a, a, a]
    (defparameter *save2* (make-array 10 :initial-element 'a)) ;[a, a, a, a, a, a, a, a, a, a]
    (loop for j from 0 to 9
     do (setq s (aref *order* j 0))
        (if (not (equalp s 0))
            (progn
            
            (loop for k from 1 to 4
             do (if (not (equalp (aref *order* j k) 0))
                    (setq *totalprice* (+ *totalprice* (aref *order* j 5)))
                )
            )
            (setq *totalprice* (+ *totalprice* (* (aref *price* (aref *order* j 0)) (aref *order* j 5))))
            (setf (aref *invoicep2* j) (format nil "~%~%~d.) Pizza size: ~a, Price: $~d, Number of Pizzas: ~d, ~% Toppings: ~a, ~a, ~a, ~a."
*k* (aref *sizes* (aref *order* j 0)) (aref *price* (aref *order* j 0)) (aref *order* j 5) (aref *toppings* (aref *order* j 1))
(aref *toppings* (aref *order* j 2)) (aref *toppings* (aref *order* j 3)) (aref *toppings* (aref *order* j 4))))
                        
            (setf (aref *save2* j) (format nil "@@~d.) Pizza size: ~a, Price: $~d, Number of Pizzas: ~d, @ Toppings: ~a, ~a, ~a, ~a."
*k* (aref *sizes* (aref *order* j 0)) (aref *price* (aref *order* j 0)) (aref *order* j 5) (aref *toppings* (aref *order* j 1))
(aref *toppings* (aref *order* j 2)) (aref *toppings* (aref *order* j 3)) (aref *toppings* (aref *order* j 4))))
                            
            (format t (aref *invoicep2* j))
            (setq *k* (+ *k* 1))
            )
        )
    )
    
    (setq *invoicep3* (format nil "~%1$ charged for Each Topping on each pizza.~%~%Order Type: ~a." (aref *ortype* (aref *order* 0 6))))
    (setq *save3* (format nil "@1$ charged for Each Topping on each pizza.@@Order Type: ~a." (aref *ortype* (aref *order* 0 6))))
    
    (setq *invoicep4* " ")
    (setq *save4* " ")
    (if (and (<= *totalprice* 30) (equalp (aref *order* 0 6) 2))
        (progn
        (setq *totalprice* (+ *totalprice* 8))
        (setq *invoicep4* (format nil "~%~%(Additional $8 Delivery Charge for Total Amount below $30.)"))
        (setq *save4* (format nil "@(Additional $8 Delivery Charge for Total Amount below $30.)")))
    )
    (setq *invoicep5* (format nil "~%~%Total Amount: $~d." *totalprice*))
    (setq *save5* (format nil "@@Total Amount: $~d." *totalprice*))
    
    (format t *invoicep3*)
    (format t *invoicep4*)
    (format t *invoicep5*)
    (setf (aref *file* 0) *save1*)
    (setf (aref *file* 1) "")
    (setq a 'a)
    (loop for j from 0 to 9
     do    (if (not (equalp (aref *save2* j) a))
            (setf (aref *file* 1) (concatenate 'string (aref *file* 1) "" (aref *save2* j)))
        )
    )
            
    (setf (aref *file* 2) *save3*)
    (setf (aref *file* 3) *save4*)
    (setf (aref *file* 4) *save5*)
    
    (setq save (format nil "~a~a~a~a~a" (aref *file* 0) (aref *file* 1) (aref *file* 2) (aref *file* 3) (aref *file* 4)))
    (setq f (open *creds* :direction :output :if-exists :append))
    (princ save f)
    (write-line " " f)
    (close f)
    (loop for o from 0 to 9
     do (loop for p from 0 to 7
         do    (setq orp (aref *order* o p))
            (if (not (equalp orp 0))
                (setf (aref *order* o p) 0))
        )
    )
    
    (loop for f from 0 to 4
     do    (setf (aref *file* f) 'fl))
    (question)
)
(defun question()
    (format t "~%~%Do you want to [A]dd another Order or [R]eturn to main Menu ?")
    (setq ans (read))
    (setq a 'a)
    (setq r 'r)
    (if (equalp ans a)
        (start2)
    (if (equalp ans r)
        (start0)
    (if (equalp ans " ")
        (start0)
        (progn
        (format t "~%~%Please Enter a Valid Option...")
        (question)))))
)
(defun views()
    (format t " ")
    (setq on 1)
    (let ((in (open *creds* :if-does-not-exist nil)))
        (when in
            (loop for line = (read-line in nil)
            
            while line
             do (format t "~%Order Number: ~d~%" on)
                (setq data (substitute #\Newline #\@ line))
                (format t "~a~%" data)
                (setq on (+ on 1))
            )
            (close in)
        )
    )
    
    (question2)
)
(defun question2()
    (format t "~%~%Do you want to [R]eturn to main Menu or [Q]uit ?")
    (setq ans (read))
    (setq q 'q)
    (setq r 'r)
    (if (equalp ans q)
        (exitp)
    (if (equalp ans r)
        (start0)
    (if (equalp ans " ")
        (start0)
        (progn
        (format t "~%~%Please Enter a Valid Option...")
        (question2)))))
)
(start0)
Python Code/.idea/dictionaries/hp.xml



creds
dataline
enterdetails
eturn
invoicep
ortype
pizzacount
pizzano
pizzaorders
psize
showorder
showpizza
sizesave
sizeselect
toppingselect
totalprice


Python Code/.idea/inspectionProfiles/Project_Default.xml















Python Code/.idea/misc.xml


Python Code/.idea/modules.xml






Python Code/.idea/Python Code.iml









Python Code/.idea/workspace.xml
























;
()














































































1569249893782


1569249893782


































Python Code/pizzaorders.txt
['Name: Yogesh\nPhone Number: 4569821751\nAddress: N.a..', '\n1.) Pizza size: Small, Price: $5, Number of Pizzas: 2,\n Toppings: Bacon, Bacon, Bacon, Bacon.\n2.) Pizza size: Medium, Price: $8, Number of Pizzas: 2,\n Toppings: Mushrooms, Mushrooms, Mushrooms, Mushrooms.', '\n1$ charged for Each Topping on each pizza.\nOrder Type: Collect.', ' ', '\nTotal Amount: $34.']
['Name: Nartana\nPhone Number: 7569821034\nAddress: Rama colony, near town gate, austria..', '\n1.) Pizza size: Large, Price: $12, Number of Pizzas: 1,\n Toppings: Mushrooms, Pineapple, Anchovies, No Topping.', '\n1$ charged for Each Topping on each pizza.\nOrder Type: Deliver.', '\n(Additional $8 Delivery Charge for Total Amount below $30.)', '\nTotal Amount: $24.']
['Name: Darshit\nPhone Number: 8756941203\nAddress: N.a..', '\n1.) Pizza size: Medium, Price: $8, Number of Pizzas: 2,\n Toppings: Mushrooms, Bacon, Olives, Pineapple.', '\n1$ charged for Each Topping on each pizza.\nOrder Type: Collect.', ' ', '\nTotal Amount: $20.']
Python Code/PizzaShop.py
import os
global creds, file, sizes, price, toppings, ortype, order
# file for storing data
creds = "pizzaorders.txt"
# temp list storing data before storing to text file
file = [0, 0, 0, 0, 0]
# list of pizza sizes
sizes = ["None", "Small", "Medium", "Large"]
# list of pizza prices according to size
price = [0, 5, 8, 12]
# list of pizza toppings
toppings = ["No Topping", "Bacon", "Olives", "Ham", "Mushrooms", "Pineapple", "Salami", "Anchovies"]
# list of order type
ortype = ["None", "Collect", "Deliver"]
# order list flags.
order = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]
class PizzaShop:
def start0(self):
print("\n-------------------------------------------------------------------------")
print("--------------------- Welcome to Pizza Shop ---------------------")
print("-------------------------------------------------------------------------")
print("Main Menu - ")
print(" Option 1.) Add Order.")
print(" Option 2.) View Orders.")
print(" Option 3.) Exit.")
self.start1()
def start1(self):
ip0a = input("Please Enter an Option: ")
if ip0a == "1":
self.start3()
elif ip0a == "2":
self.views()
elif ip0a == "3":
self.exit()
else:
print("\nPlease Enter the Correct Option.")
self.start1()
def exit(self):
print("\nDo you really want to QUIT ?")
print("[Y]es / [N]o : ")
aq5 = input()
if aq5.upper() == "Y":
print("\n Thanks for using Pizza Shop Application...!\n")
input()
quit()
elif aq5.upper() == "N":
print(" ")
os.system("cls")
self.start0()
else:
print("Please Enter Correct Option...")
self.exit()
def start2(self):
print("\nAdd a new Order...")
self.start3()
def start3(self):
print("\nPlease Select an Option for Pizza Size from below: ")
print(" Option 1.) Small Pizza - $5 ")
print(" Option 2.) Medium Pizza - $8 ")
print(" Option 3.) Large Pizza - $12 ")
self.sizeselect()
def sizeselect(self):
global psize
try:
inp1a = int(input("Please Enter an Option for Pizza Size : "))
except:
print("\nPlease Enter a Valid Option for Pizza size.")
self.sizeselect()
if inp1a in range(0, 4):
psize = inp1a
self.sizesave()
else:
print("\nPlease Enter the Correct Option for Pizza size.")
self.sizeselect()
def sizesave(self):
global i
i = 0
for integers in order:
s =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here