Page 1 of 10 Programming Assignment Introduction to Information Technology 4478 Note 1: Only use IDLE (with Python 3.6 or above) to write this assignment! For the purpose of this assignment, you are...

1 answer below »
Please let me know soon thanks


Page 1 of 10 Programming Assignment Introduction to Information Technology 4478 Note 1: Only use IDLE (with Python 3.6 or above) to write this assignment! For the purpose of this assignment, you are not allowed to use any other Python IDE and you are not allowed to use any other version of the Python. Note 2: Familiarise yourself with the Python Style Guide at the end of this document. Note 3: All cases of plagiarism will be pursued! If in doubt, consult the Student Academic Integrity Policy http://www.canberra.edu.au/current-students/canberra-students/conduct Note 4: This work must be your original work, I may request to meet any student to discuss their submission. This assignment will test a student’s knowledge of, and skills in writing application software for a task, understanding the business rules of a particular problem, coding these in a computer program, developing a graphical user interface, reading data from a text file on disk, and connecting to an SQL database from within the program. As such, the assignment requires you to integrate and synthesise what you have learnt so far in this unit, in order to design and create a correct working solution. The context of this programming assignment is the Chook Food Company. For this assignment, students will use the Python programming language (version 3.x) and development will be on the IDLE platform as practised in the computer lab classes. This assignment consists of three stages. • Stage 1: A simple Python program using an interactive text-based menu (no GUI) • Stage 2: The same (stage 1) but wrapped in a GUI • Stage 3: Input comes from a text file – read only once, then information stored in a suitable data structure. (Advanced GUI) 4478 IIT Part A – Stage 1 (25 marks) Part B – Stage 2 (10 marks) Part C – Stage 3 (15 marks) Chook Food Company App Each type of chook food comes in 10 Kg bags and 50 Kg bags. Each chook food has a name, the cost of a 10 Kg bag and the cost of a 50 Kg bag. Stage 1: Pellets cost $22.75 for a 10 Kg bag and $100 for a 50 Kg bag. Mash costs $20.50 for a 10 Kg bag and $90 for a 50 Kg bag. Enhanced food costs $25.50 for a 10 Kg bag and $125.50 for a 50 Kg bag. These details can be hardcoded in your program (you may use a nested list to store these values). For this stage, your program should know about the three types of food above. http://www.canberra.edu.au/current-students/canberra-students/conduct Page 2 of 10 In Stage 1, you will be developing a Python program without a GUI. Input and output are via the Python shell. Write a Python program that displays a text based interactive menu to allow the users to: • Request displaying costs of the chook food for 10Kg or 50 Kg bags. • Perform chook food shopping as follows: 1- Allow the user to select the type of food they want to purchase from the menu. 2- Allow the user to select the price calculation method according to: 2.1 The Kilograms option, the user enters only the number of 10 kilograms increments, after that the price is calculated by using the cheapest way to buy exactly that weight of the chook food selected. The answer will be the number of 10 Kg bags or the number of 50 Kg bags and the total cost (see the sample test document). 2.2 The Bags options, the user needs to enter the number of 10kg bags and the number of 50kg bags and the price will be calculated according to these two choices (see the sample test document) Notes: • You should use functions for each task in the program, for example a printMenu function to print a menu and calculcateCost to calculate the cost of chook food etc. • Your program should have a main() function to appropriately direct the program. What the tutors will be looking for The tutor’s instructions include • Constants vs literals. Using constants is important for the ease of maintenance. Not using constants will result in lower marks. For example, consider constants for the price of chook food for 10Kg bag and 50 Kg bag. • Program code layout. Separate blocks of code by a blank line. Use comments. • Program is written using well-defined functions including a main() function to direct the program. • A comment is not an essay. Comments are important for the maintenance of a program and should contain enough details but keep them concise. Do not comment every single line. • The program must have a prologue. Check style against the Python style guide attached below. • Good names for your variables and constants. Check style against the Python style guide attached below. • Does the program work correctly? Please refer to the Programming Assignment Marking Rubric for details on marks. Step-by-Step Guide for Stage 1 1. Think about your strategy for how you will display the options for user to choose from, how you will calculate the total cost of chook food and how you would calculate the cheapest way to buy the chook food with given weight. Think about writing simple functions for the repetitive calculations. 2. Create a new Python file and call it ProgAsgStage1 Page 3 of 10 3. In the Stage1 class (file ProgAsgStage1.py), you may put all code for the user interaction and the calculation into the main method. (You might still need to define global variables and constants outside the main method at the top of the editor window). You might like to use nested lists to hold the chook food type and price for 10kg bag and 50 kg bag. 4. You will need to write a function to print a menu to the user, below a sample code as an example: 5. Now add the code that implements your strategy to display the different type of chook food TEST 6. Add the code to calculate the cost of 10 Kg bags and 50kg bags when a chook food is selected TEST 7. Add the code to calculate the cheapest way to buy the chook food for the weight entered TEST 8. Finally, add print statements to print the output to the user. 9. Test your implementation with the test cases, use the document (sampleTest - stage 1) as a guide. Please note, you need to do your own test with values different from the test cases in the document (Check the submission section in the last page). Page 4 of 10 Stage 2: In stage1, the user input and output are not very satisfactory from the human computer interaction and usability point of view, your task in this stage is to design and implement a Graphical User interface (GUI) using buttons and labels for the chook food company that provides an easy to use interface. The tasks are like stage 1, except you need to use GUI to interact with user. This GUI application must allow a user to input the various data elements. To this end, the user can • input the data using an entry widget • click on a Calculate button that starts the calculation of the chook food cost, and • an Exit or Quit button to properly close the program. Use the same code for the calculations from Stage 1. Reusing code is an important part of software development. You have a great degree of freedom in what GUI elements you choose and how you would like to design the layout of your GUI. What matters is the functionality of the design and that the user can input the required data in a sensible fashion. What the tutors will be looking for The tutor’s instructions include • Constants vs literals. Using constants is important for the ease of maintenance. Not using constants will result in lower marks. For example, in addition to Stage 1, consider constants for the default width and height of the labels, buttons and entry widgets to easily achieve a uniform look. • GUI Design. Is it simple to use and easy to understand? Are all required components there? Grid layout is used to place widgets. • Program is written using well-defined functions including a main() function to direct the program. • Program code layout. Separate blocks of code by a blank line. Use comments. • Separate GUI functionality from calculations. Students should use a separate method for the calculations. It is good practice and follows good programming style to separate GUI code from other code. • A comment is not an essay. Comments are important for the maintenance of a program and should contain enough details but keep them concise. Don’t comment every single line. • The program must have a prologue. Check style against the Python style guide attached below. • Good names for your variables and constants. Check style against the Python style guide attached below. • Does the program work correctly? Please refer to the Programming Assignment Marking Rubric for details on marks. Page 5 of 10 Stage 3: Complete the stage 1 & stage2 plus: The program will determine the list of chook food at run time. Do this by reading this data from the file chookfood.txt and data will be stored in a nested list. chookfood.txt is available on IIT Canvas site. The file chookfood.txt contains the chook food data for several chook food type. Each line consists of chook food type as the first element, followed by comma and the price of 10Kg bag and price of 50Kg bag. For example: Mash, 20.50,90.00 You will need to copy chookfood.txt into the same directory as your Python files. When marking, the details in the file may change, but the structure will not. Your task will be to: 1- Add code to your program that reads the chook food data from a text file. 2- Put these into appropriate storage in memory (I suggest you use a nested list) and display the details to user when requested. Please note that
Answered 2 days AfterApr 24, 2021University of Canberra

Answer To: Page 1 of 10 Programming Assignment Introduction to Information Technology 4478 Note 1: Only use...

Kamal answered on Apr 26 2021
141 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here