| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1118 人关注过本帖
标题:谁帮小弟做份考试题?
只看楼主 加入收藏
zhangleitb
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-12-2
收藏
 问题点数:0 回复次数:10 
谁帮小弟做份考试题?
看到一份题,怎么这么难,谁能帮我做做啊?


CP1200 - Assignment 2 - 2007-1 - Point of Sale System

Problem 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.

[[it] 本帖最后由 zhangleitb 于 2008-12-9 21:06 编辑 [/it]]
搜索更多相关主题的帖子: 难题 
2008-12-09 20:59
zhangleitb
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-12-2
收藏
得分:0 
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.)

Submission
Your Part1 code file gets submitted individually to the “A2 Part1” box on LearnJCU.
Your two main files (IPO in Word or PDF and your cpp code file) get submitted to the “A2 POS” box in LearnJCU. Do not zip them up. Just add one file, then click “Add another file” to upload the second, then click Submit. If you have a hand-drawn flowchart, please clearly name this and give it to your lecturer. Other kinds of files (VSD, ZIP, RAR, etc.) will not be accepted.

Sample Output
Run the executable file for more examples of how your system should respond (e.g. if it doesn’t check for invalid characters in the price, then you don’t have to).


Welcome to the CP1200 POS System
Created by Student Name
Please enter your security code: 5044
Security code not found!
Please enter your security code: 50455
Invalid length security code.
Please enter your security code: '123
Invalid character in security code.
Please enter your security code: 5844

Bruce, please choose an option:
1.      List items for sale
2.      *Add item
3.      Purchase items
4.      Logout
5.      Quit
1
2008-12-09 21:00
zhangleitb
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-12-2
收藏
得分:0 
List (a)ll, or only within price (r)ange? a
0001 - Fish hook (Useful for catching fish): $0.50*
0110 - Metronome (A device for keeping musical time): $49.00*
1234 - Basil (Bunch of basil): $2.50

Bruce, please choose an option:
1.      List items for sale
2.      *Add item
3.      Purchase items
4.      Logout
5.      Quit
2
You need to be an administrator to add items.

Bruce, please choose an option:
1.      List items for sale
2.      *Add item
3.      Purchase items
4.      Logout
5.      Quit
4
Goodbye, Bruce
Please enter your security code: 1234

Lindsay, please choose an option:
1.      List items for sale
2.      *Add item
3.      Purchase items
4.      Logout
5.      Quit
2
Please enter item details:
Code:     0001
Item code 0001 already exists!
Code:     0002
Name:     Bread
Descr:
Description can not be blank!
Descr:     Essene Sprouted Bread
Price:    5.20
GST(1/0): 8
GST must be 0 or 1!
GST(1/0): 0
Bread added.

Lindsay, please choose an option:
1.      List items for sale
2.      *Add item
3.      Purchase items
4.      Logout
5.      Quit
1
2008-12-09 21:00
zhangleitb
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-12-2
收藏
得分:0 
List (a)ll, or only within price (r)ange? r
Lowest price:  $-2
Lowest price must be $0 or more!
Lowest price:  $0
Highest price: $0
Highest price must be greater than lowest price!
Highest price: $6
0001 - Fish hook (Useful for catching fish): $0.50*
1234 - Basil (Bunch of basil): $2.50
0002 - Bread (Essene Sprouted Bread): $5.20

Lindsay, please choose an option:
1.      List items for sale
2.      *Add item
3.      Purchase items
4.      Logout
5.      Quit
3
Enter code of item to buy (-1 to finish): 0001
Enter code of item to buy: 0001
Enter code of item to buy: 0003
Invalid item code!
Enter code of item to buy: 0002
Enter code of item to buy: -1
0001 - Fish hook (Useful for catching fish): $0.50*
0001 - Fish hook (Useful for catching fish): $0.50*
0002 - Bread (Essene Sprouted Bread): $5.20
3 items.
Total cost:       $6.30
Including GST of: $0.10

Lindsay, please choose an option:
1.      List items for sale
2.      *Add item
3.      Purchase items
4.      Logout
5.      Quit
6
Invalid option!

Lindsay, please choose an option:
1.      List items for sale
2.      *Add item
3.      Purchase items
4.      Logout
5.      Quit
5
Goodbye, Lindsay
Press any key to continue . . .
2008-12-09 21:01
zhangleitb
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-12-2
收藏
得分:0 
在线等答案
2008-12-09 21:03
zhangleitb
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-12-2
收藏
得分:0 
2008-12-09 21:08
追求完美
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-12-4
收藏
得分:0 
2008-12-09 22:27
广陵绝唱
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:29
帖 子:3607
专家分:1709
注 册:2008-2-15
收藏
得分:0 
请把它翻译过来再发……
2008-12-09 23:20
新浪
Rank: 3Rank: 3
来 自:水星
等 级:论坛游侠
威 望:1
帖 子:770
专家分:167
注 册:2008-6-10
收藏
得分:0 
TO louzhu:
You think you're full of niubility,

and like to play zhuangbility,

however,

those only reflect your shability.

you know?

一笑而过
呵呵

天下皆醒,唯我独醉;  天下皆白,唯我独黑
2008-12-09 23:22
daoran
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-8-26
收藏
得分:0 
跟楼上的学会3个单词
2008-12-10 08:37
快速回复:谁帮小弟做份考试题?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.048581 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved