Code a console-based program in python

Assignment Help Python Programming
Reference no: EM131224309

Task:

You are to plan and then code a console-based program in Python 3, as described in the following information and sample output. This assignment will help you build skills using selection, repetition, file input/output, exceptions, lists/tuples, functions and string formatting. Do not to define any of your own classes. Assignment 2 will build on this program with more advanced code constructs including classes and a Graphical User Interface (GUI). Work incrementally on this task: complete small parts of it at a time rather than trying to get it all working at once.

Program Overview:

This program is a simple shopping list that could also be used for TODOs or similar purposes. The program maintains a list of items in a file, and each item has:

  • name, price, priority (1, 2 or 3), whether it is required or completed

Users can choose to see the list of required items or completed items, including a total of the (estimated) price of all of those items. The lists will be sorted by priority.

Users can add new items and mark items as completed.

They can't change items from completed to required.

Program Functionality Details:

Ensure that your program has the following features, as demonstrated in the sample output below.

Your program should:

  • display a welcome message with your name in it
  • display a menu for the user to choose from
  • return to the menu and loop until the user chooses to quit
  • error-check user inputs as demonstrated in the sample output
  • start by loading a CSV (Comma Separated Values) file of items that are in stock for hire;

a sample CSV file is provided for you

  • (when the user chooses list) display a neatly formatted list of all the required items with their prices lined up and priorities
  • (when the user chooses show completed) display a similarly formatted list of completed items
  • (when the user chooses add) prompt for the item's name, price and priority, error-checking each of these, then add the item to the list in memory
  • (when the user chooses complete) display the same list of required items, then allow the user to choose one (error-checked), then change that item to completed if no items are required, then a message should be displayed and the user returned to the menu
  • (when the user chooses quit) save the items to the CSV file, overwriting the file contents

Coding Requirements and Suggestions:

  • Make use of named constants where appropriate.
  • Use functions appropriately for each significant part of the program: this is the divide-and-conquer problem-solving approach. Remember that functions should "do one thing".

Look for situations where functions can be used to reduce code duplication (e.g. displaying the completed and required lists is very similar).

  • For efficiency, you should only load the items file once. Store the results appropriately in a list of lists that you can pass to any functions that need access to it.
  • Note that the menu choice should handle uppercase and lowercase letters.
  • Use exception handling where appropriate to deal with input errors (including entering numbers and selecting items).
  • Check the rubric carefully to see any other aspects of the coding that you will be assessed on.

Attachment:- Assignment.rar

Reference no: EM131224309

Questions Cloud

Discuss one the metaphors from morgans writings : Discuss one the metaphors from Morgan's writings (Click here) that applies to your own organizational context. From the perspective of a leader/manager.
Shareholders and investors play in corporate governance : What role do shareholders/investors play in corporate governance? How can they effect corporate change?
Write a memo to the head of the foundation or organization : Identify a foundation or other organization that is supporting solutions to this problem. Write a memo to the head of the foundation or organization reporting what you have discovered.
Traditional project management : Compare and contrast how a scope is created in traditional project management versus one created in agile project management.
Code a console-based program in python : CP1404/CP5632 2016 SP2/22/52 Assignment 1 - Shopping List 1.0. You are to plan and then code a console-based program in Python 3, as described in the following information and sample output. This assignment will help you build skills using selectio..
Resolve dispute that cannot be negotiated to a settlement : Arbitration is one of the better ways to resolve a dispute that cannot be negotiated to a settlement. The reason is that if you go to trial in a foreign country, you will be at the mercy of the courts in the foreign country but if you agree in advanc..
Test it with a progressively developed driver program : Test it with a progressively developed driver program that verifies the functionality of all of its methods.
How the local environment issue is affecting your community : Explains how this local environment issue is affecting your community. Explains how your chosen two schools of thought view this local environmental issue. Addresses any ethical concerns or controversies surrounding this environmental issue.
People minds are changed through observation : "People minds are changed through observation and not through argument."  - Where is this quote using pathos, logos and ethos.

Reviews

len1224309

9/29/2016 1:32:55 AM

Sample output from the program is attached. Make sure that your program matches the sample output including spaces, spelling, and especially the formatting of the item lists. Think of this as helpful guidance as well as training you to be particular and pay attention to detail. The sample output is intended to show the full range of situations including user input error handling.

Write a Review

Python Programming Questions & Answers

  Displays the charges for a patients hospital stay

Write a program that computes and displays the charges for a patient's hospital stay. First, the program should ask patient name and if the patient was admitted as an in-patient or an out-patient.

  The block of statements below the line of stars

The block of statements below the line of stars is where I need help correcting. The true line that needs to be corrected is p = add((getX(k),getY(r))), it needs to give points of the path using the block of information. I have somthing which I kn..

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Reinforce topic material on simple functions

Select 3 sets of test data that will demonstrate the correct 'normal' operation of your program. Select another 2 sets of test data that will demonstrate the "abnormal" operation of your program.

  Implement key exchange using the diffie-hellman algorithm

Implement key exchange using the Diffie-Hellman algorithm, when peer-to-peer connections are made between bots. Achieve con dentiality through encryption of the client-server communications with an appropriate block or stream cipher

  Create an inheritance relationship between two classes

For this assignment you will create a simple class hierarchy. You will create an inheritance relationship between two classes -- a Friend class and a Person class - Friend will inherit Person

  Write a python program that performs simple encryption

You are required to write a Python program that performs simple encryption and decryption on strings entered by the user. To do so, you are to use one of the simplest and most widely known encryption techniques known as the Caesar Cipher

  Implement your algorithm in python

Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified and reinforce topic material related to the programming work cycle, and the input, processing, output program structure.

  Implement core security features

What you will be implementing here is inspired by real world cases such as the Conficker work. To have any chance of defeating such a threat, you need to understand how they defend themselves.

  Write a program that acts like a simple calculator

You will write a program that acts like a simple calculator for binary numbers. You should read in a string of input that has the format: number operator number.

  Project title email spam filterabstractanalyze the emails

project title email spam filterabstractanalyze the emails and predict whether the mail is a spam or not a spam.to work

  Write a program using the requetinteger function

write a program using the 'requetInteger' function that will ask the user to type a value that will draw a line from one point on a picture to another.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd