Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Programming Assignment #1: Grocery Store

This assignment attempts to serve as a refresher for concepts that I hope you learned in CS 122. In this assignment, you will be building a simple storefront for a small grocery store called Jack's Mart. The store maintains its inventory in a text file. Not being very tech savvy, the owner of Jack's Mart needs you to build a program to read from and maintain the list of currently stocked items. The program will also simulate a simple shopping cart in which customers may add items.

File Format

Your program should read a file called "grocery_list.txt" (see included file for an example file). Each line of the file contains one grocery item. Each item contains three pieces of information: the name of the item, the item's quantity, and the item's cost. Each piece of information is separated by a colon (:). For example, "cheese:5:6" means that the item's name is "cheese", that there are 5 pieces of cheese in stock, and that each piece of cheese costs $6.

Program Flow

Your program should operate in the following manner:

• Open the file "grocery_list.txt".
• Read the names and quantities of items from the text file.
• Prompt the user for the amount of money that they currently have.
• Until the shopper decides to exit, do the following:

o Display a menu with the currently stocked items, their cost, and their quantities.
o Ask the shopper what they'd like to add to their cart.
o If the item exists and there is sufficient quantity, add the item to their cart.
o If the item does not exist, let the user that the item is not in stock.
o If the item costs more than what the users has, let the user know that they have insufficient funds to make the purchase.
o Update the list of items currently in stock to reflect the new quantities.

• After the user has decided to exit, display the current contents of the shopping cart along with how much was spent and how much money the user has left over.

• Note that the program should also write back to "grocery_list.txt" with the updated quantity of items.

Header Comment, and Formatting

1. Be sure to modify the file header comment at the top of your script to indicate your name, student ID, completion time, and the names of any individuals that you collaborated with on the assignment.

2. Remember to follow the basic coding style guide. For a list of basic rules or examine my example files from previous assignments and labs.
Reflection Essay

In addition to the programming tasks listed above, your submission must include an essay that reflects on your experiences with this homework. This essay must be at least 350 words long. Note that the focus of this paper should be on your reflection, not on structure (e.g. introductory paragraph, conclusion, etc.). The essay is graded on content (i.e. it shows deep though) rather than syntax (e.g. spelling) and structure. Below are some prompts that can be used to get you thinking. Feel free to use these or to make up your own.

• Describe a particular struggle that you overcame when working on this programming assignment.

• Conversely, describe an issue with your assignment that you were unable to resolve.

• Provide advice to a future student on how he or she might succeed on this assignment.

• Describe the most fun aspect of the assignment.

• Describe the most challenging aspect of the assignment.

• Describe the most difficult aspect of the assignment to understand.

• Provide any suggestions for improving the assignment in the future.

Deliverables

You must upload your program and reflection as a ZIP file through the web no later than midnight on Friday, September 9, 2016. Remember that your submission must either contain a CodeBlocks or Visual Studio project file!

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91956498
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Programming Language

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As