CP5639 SP23 2018 – Assessment 1 Planning Completed by: Student Number: Function List: functionName [Write a one or two sentence description of what your function will do. Describe any inputs and...

Assignment


CP5639 SP23 2018 – Assessment 1 Planning Completed by: Student Number: Function List: functionName [Write a one or two sentence description of what your function will do. Describe any inputs and outputs] NOTE: DO NOT FORGET TO ADD A FUNCTION FOR MAIN. function functionName Input Processing Output Condition Action ! How many people are you buying Christmas presents for?” 3. Ask the user the budget available to spend. Make sure there’s enough money to buy at least a present. “Thank you! What is your budget for all these gifts?” 4. Show the user the items available in store, one by one with price. Ask the user if he wants to purchase the item; if so, place the item aside and tell the user how much money he has left for the remaining presents. The Christmas gifts available in shop are: - Pair of Christmas socks - $10 - Box of luxury chocolates - $15 - Scarf with reindeers - $25 - Smart doll - $45 - Marzipan globes - $10 - Comfy fluffy slippers - $20 - Pineapple headset - $50 - Personalised watch - $85 - Pearl earrings - $150 - Universal charger - $30 - Rudolph’s nose - $10 - Gingerbread house - $20 - Decorative lights - $15 - New Year Diary - $30 - Snow globe - $15 - Dancing reindeer - $25 - Snowflake ballerina - $25 - Silk scarf with snowflakes - $50 - Leather lady gloves - $75 - Remote controlled car - $95 5. The program ends when one of the following happens: - gifts have been purchased for all family members - all money has been spent - there is not enough money left to purchase any more gifts - all items have been presented yet the user hasn’t purchased gifts for all the family 6. Show the user a summary of the gifts bought, as well as the total spending and the remaining money left. Planning: You are to divide your solution into functions, following the principles shown in class. These may involve functions for reading the user input as well as functions for parts of the program (e.g. calculating the remaining amount of money after buying one item can be done in a function). For each function you are to provide an IPO chart listing all variables which are needed for your solution. In cases where selections are necessary you must include a suitable condition action table directly below the IPO chart. Where iterations take place, you must show a loop table (loop variable and exit condition). Make sure you follow the structure presented in the assignment template available on LearnJCU. You also need to provide an algorithm in pseudocode for each function, making sure to clearly indicate the input and output variables for each. You may show your assignment to your tutor during practical time to get comments or suggestions. It is important to note that you can only get help from staff in practical time after your practical work is finished. General Principles: In this assignment, you will be focusing on basic planning using selections, repetitions and functions. Use the techniques and patterns that you have learned and seen demonstrated in class. · You must make sure that any functions that get input from the user do error checking to ensure that the input is within the expected range (greater than zero, etc) or format. · Valid input should accept lowercase as well as uppercase ie for a Yes answer both Y and y are accepted · Where appropriate, make use of constants (named in all caps). Remember to use your constants everywhere you can. Submission: Hand in: · A MS Word (.docx) or PDF (.pdf) file containing your planning, using the template available on LearnJCU. · Please name the file like: FirstnameLastnameA1.docx or FirstnameLastnameA1.pdf · e.g. if your name were Miles Davis, the filename would be MilesDavisA1.docx; upload it on LearnJCU under the assessment drop box. Due: Submit your assignment by the date and time specified on LearnJCU. Submissions received after this date will incur late penalties as described in the subject outline. Integrity: The work you submit for this assignment must be your own. You are allowed to discuss the assignment with other students and get assistance from your peers, but you may not do anyone else’s work for them and you may not get anyone else to do any part of your work. Programs that are detected to be too similar to another student’s work will be dealt with promptly according to University procedures for handling plagiarism. If you require assistance with the assignment, please ask general questions on the LearnJCU discussion board, or get specific assistance with your own work by talking with your lecturer or tutor. Example of program run: CGS: Welcome to the Christmas Gift Shop! What is your name? U: CGS: Don’t be shy. What is your name? U: James CGS: Hello James! How many people are you buying Christmas presents for? U: abc CGS: Please tell me a valid number. How many people are you buying Christmas presents for? U: 0 CGS: Please tell me a valid number. How many people are you buying Christmas presents for? U: 3 CGS: Thank you! What is your budget for the gifts? U: qwe CGS: Please tell me a valid number. What is your budget for the gifts? U: 100 CGS: Great, let’s start by showing you the presents we have available! This item is a Pair of Christmas socks at $10. Would you like to purchase it (Y/N)? U: asd CGS: I’m sorry I can’t understand. This item is a Pair of Christmas socks at $10. Would you like to purchase it (Y/N)? U: y CGS: The item has been placed aside for you. The budget available at this stage is $90 and you have 2 more gift(s) to purchase. This item is a Box of luxury chocolates at $15. Would you like to purchase it (Y/N)? U: N CGS: This item is a Scarf with reindeers at $25. Would you like to purchase it (Y/N)? U: Y CGS: The item has been placed aside for you. The budget available at this stage is $65 and you have 1 more gift(s) to purchase. This item is a Smart doll at $45. Would you like to purchase it (Y/N)? U: y CGS: The item has been placed aside for you. You have finished shopping! Here's a summary of the gifts purchased: Pair of Christmas socks at $10 Scarf with reindeers at $25 Smart doll at $45 You had $100 and you spent $80. Your change is $20. Thank you for visiting the Christmas Gift Shop! Have a Merry Christmas! Additional scenarios: ... CGS: What is your budget for the gifts? U: 0 CGS: The remaining money is not enough to buy all the gifts you want. Thank you for visiting the Christmas Gift Shop! Have a Merry Christmas! ... CGS: You have seen all items available in our shop. Here's a summary of the gifts purchased: ... Marking Scheme: Criteria Exemplary (9 – 10) Good (7 – 8) Satisfactory (5 – 6) Limited (2 – 4) Poor (0 – 1) Proposes strategies or partial solutions The plan is completely correct and solves the problem. The solution handles all input scenarios correctly. Exhibits aspects of exemplary (left) and satisfactory (right) The plan mostly solves the problem, but there are many design flaws or missing elements. Exhibits aspects of satisfactory (left) and poor (right) No solution provided Largely conveys meaning to the audience, despite occasional lapses in sentence structure, grammar, punctuation and spelling. Language used in planning document is clear. Language used in planning documents is generally understandable. There are mistakes in spelling and grammar. Use of language in planning documents is incomprehensible or non-existent. Appropriate use of problem-solving tools (including algorithm, IPO charts and condition/action tables) to communicate the planned solution The algorithm provided is consistent across all parts of the planning documentation and no steps are omitted. All variables are listed in IPO charts. Every Selection has a Condition/Action table and every loop is correctly planned The algorithm provided is not consistent with other parts of the planning documentation and/or some steps are omitted. Variables are missing from IPO charts, or unused variables are listed. Selections or loops are not correctly planned. No or minimal use of any problem-solving tools, or all tools are incorrectly used Effective and correct use of variables in the planned solution The variables identified are all appropriate and correctly used. All variable names are valid and meaningful Most variables identified are appropriate and correctly used. Most variable names are valid and meaningful No variables identified, or all variables are inappropriate or incorrect Effective and correct use of functions in the planned solution The functions identified are appropriate and correctly used. Function inputs and outputs are appropriate. All function names are valid and meaningful Most functions are appropriate and correctly used. Most of the inputs and outputs are correct. Most function names are valid and meaningful No functions identified, or all functions are incorrectly used. All inputs or outputs are incorrect. All names are invalid or unclear Effective and correct use of conditionals and loops in the planned solution. The conditionals and loops used are appropriate and correctly used. All loops exit when appropriate and all decisions are correctly designed Most of the conditionals and loops used are appropriate and correctly used. Most loops exit when
Dec 07, 2020CP5639
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here