◆求C++程序代写◆这是期末作业我实在是不会了...555◆
给你们看下作业要求..我快崩溃了 有偿求代码~~加我QQ:1942903Problem Description:
With your recent software development experience, you are now asked to design and create a Point of Sale (POS) system.
The system will start by asking for a 4-digit security code, which must exist in the security file (security.txt). This file also stores the users’ names (so the system can be polite) and admin level.
After the code has been accepted, there will be a menu with the following functionality:
1. List items for sale - this gives the user the choice of listing all items or only items within a certain price range.
2. *Add item - for adding the details for a new item and storing it in the data file and memory.
3. Purchase items - for POS processing; customers buy one or more items (the clerk enters the codes) and the system presents a ‘docket’ with the total price and other details.
4. Logout - this option allows a new clerk to login, entering a new security code.
5. Quit
*The Add item functionality is only available to administrators. Administrators are identified by the ‘a’ character after their code in the security file.
You are provided with sample security and data files, which the system must use (no other file format).
You are also provided with a working executable, so you can test the program to see how it should run.
See the sample output below (and executable file) for more details of how the program should work.
• Your program should format all currency amounts with two decimal places, e.g. $450.00.
• You should check the login code is exactly 4 numeric characters, as shown in the sample.
• When adding items, you should check for valid input: item codes must be 4 numeric characters and must not already exist, item names and descriptions can’t be blank, item prices can’t be $0 or less, GST must be 1 or 0.
• You are to handle file errors with the following error messages: if a file fails to open for reading, display “Error opening file!”, or writing, display “Error writing to file!”.
• You can assume that the data file will have a maximum of 100 entries and that customers will purchase no more than 20 items per transaction.
• You only need to load the data file into memory once, at the start of the program. You should use an appropriate array of structs for this. The security file should not be loaded into memory.
• Your output formatting should match the samples provided. Use these to test your work. The sample output and exe form part of the specification. Your program should match as exactly as possible.
• You should create functions as appropriate (using logical function design). E.g. if you need to display the products when listing them and also when purchasing them, you might use a function for this.
• You should write good code using the principles taught in class, including things like choosing appropriate data types, use of constants, variable naming conventions, formatting and good commenting. Try not to repeat any mistakes you made in your first assignment.
• Check the assignment marking sheet for details on how marks are given for this assignment. Try not to miss anything, and if you are unsure of something, please ask about it on the LearnJCU discussion board, in the Assignment 2 forum.
You are to produce:
• An IPO chart with the algorithm in either pseudocode or flowchart.
You must use the template IPO file provided, including the sample function (note that each function goes in a separate table). This part of the assignment can be shown to your tutor during the practical in week 11, where they will give feedback. If you are doing a flowchart, it can be hand-drawn if you like. If creating an electronic flowchart, copy it into your IPO Word document. Pseudo code may not be hand-written. (No desk-check is required, but you may like to do one for your testing.)
Name this file as for the template you’re provided: LastnameFirstNameCP1200A2IPO.doc
• Functional sub-section code file called LastnameFirstnameCP1200A2Part1.cpp.
This is due in week 11 and is to be a working, partially complete program that does the main looping menu system and has mostly empty functions for each function you plan to write (e.g. when the user chooses 1, it runs the function to list the items, which doesn’t have to do anything except maybe a cout statement). This is an important step in code development (doing a complete sub-section of the whole program), and to encourage you to work this way, you will lose 10% of the total if this is not submitted. Do this as the first step in coding your IPO plan!
• Complete, functional code (one .cpp file) containing appropriate comments.
Call this: LastnameFirstnameCP1200A2.cpp (don’t submit projects/solutions, etc.)
[[it] 本帖最后由 锅锅 于 2008-12-7 16:14 编辑 [/it]]